OLD | NEW |
1 # == Class: geoip | 1 # == Class: geoip |
2 # | 2 # |
3 # Manage GeoIP (http://dev.maxmind.com/geoip/) databases. | 3 # Manage GeoIP (http://dev.maxmind.com/geoip/) databases. |
4 # | 4 # |
5 # === Parameters: | 5 # === Parameters: |
6 # | 6 # |
7 # [*cron*] | 7 # [*cron*] |
8 # Default options for Cron['geoip'], e.g. $minute, $monthday etc. | 8 # Default options for Cron['geoip'], e.g. $minute, $monthday etc. |
9 # | 9 # |
10 # [*ensure*] | 10 # [*ensure*] |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 $version = undef, | 42 $version = undef, |
43 ) { | 43 ) { |
44 | 44 |
45 ensure_resource('package', $packages, { | 45 ensure_resource('package', $packages, { |
46 ensure => $ensure ? { | 46 ensure => $ensure ? { |
47 /^(absent|purged)$/ => $ensure, | 47 /^(absent|purged)$/ => $ensure, |
48 default => $version ? {undef => 'present', default => $version}, | 48 default => $version ? {undef => 'present', default => $version}, |
49 }, | 49 }, |
50 }) | 50 }) |
51 | 51 |
| 52 # Remove any manually installed geoip-database-contrib |
| 53 package{'geoip-database-contrib': |
| 54 ensure => 'purged', |
| 55 require => Cron['geoip'], |
| 56 } |
| 57 |
| 58 |
52 create_resources('cron', {geoip => $cron}, { | 59 create_resources('cron', {geoip => $cron}, { |
53 command => $hook ? {undef => $script, default => "$script && $hook"}, | 60 command => $hook ? {undef => $script, default => "$script && $hook"}, |
54 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, | 61 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, |
55 hour => 0, | 62 hour => 0, |
56 minute => 0, | 63 minute => 0, |
57 user => 'root', | 64 user => 'root', |
58 }) | 65 }) |
59 | 66 |
60 file {$script: | 67 file {$script: |
61 before => Cron['geoip'], | 68 before => Cron['geoip'], |
62 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, | 69 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, |
63 mode => 0755, | 70 mode => 0755, |
64 require => Package[$packages], | 71 require => Package[$packages], |
65 source => 'puppet:///modules/geoip/update.py', | 72 source => 'puppet:///modules/geoip/update.py', |
66 } | 73 } |
67 } | 74 } |
OLD | NEW |