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 create_resources('cron', {geoip => $cron}, { | 52 if $::lsbdistcodename == 'precise' { |
53 command => $hook ? {undef => $script, default => "$script && $hook"}, | 53 create_resources('cron', {geoip => $cron}, { |
54 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, | 54 command => $hook ? {undef => $script, default => "$script && $hook"}, |
55 hour => 0, | 55 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'
}, |
56 minute => 0, | 56 hour => 0, |
57 user => 'root', | 57 minute => 0, |
58 }) | 58 user => 'root', |
| 59 }) |
59 | 60 |
60 file {$script: | 61 file {$script: |
61 before => Cron['geoip'], | 62 before => Cron['geoip'], |
62 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'}, | 63 ensure => $ensure ? {/^(absent|purged)$/ => 'absent', default => 'present'
}, |
63 mode => 0755, | 64 mode => 0755, |
64 require => Package[$packages], | 65 require => Package[$packages], |
65 source => 'puppet:///modules/geoip/update.py', | 66 source => 'puppet:///modules/geoip/update.py', |
| 67 } |
66 } | 68 } |
67 } | 69 } |
| 70 |
OLD | NEW |