OLD | NEW |
1 class logrotate { | 1 class logrotate { |
2 exec {'ensure_logrotate_status': | 2 exec {'ensure_logrotate_status': |
3 command => '/etc/cron.daily/logrotate', | 3 command => '/etc/cron.daily/logrotate', |
4 path => ["/usr/bin/", "/bin/"], | 4 path => ["/usr/bin/", "/bin/"], |
5 onlyif => 'test ! -f /var/lib/logrotate/status' | 5 onlyif => 'test ! -f /var/lib/logrotate/status' |
6 } | 6 } |
7 | 7 |
8 cron {'logrotate': | 8 cron {'logrotate': |
9 ensure => present, | 9 ensure => present, |
10 require => Exec['ensure_logrotate_status'], | 10 require => Exec['ensure_logrotate_status'], |
11 command => '/usr/sbin/logrotate /etc/logrotate.conf', | 11 command => '/usr/sbin/logrotate /etc/logrotate.conf', |
12 environment => ['MAILTO=admins@adblockplus.org,root'], | 12 environment => hiera('cron::environment', []), |
13 user => root, | 13 user => root, |
14 hour => '0', | 14 hour => '0', |
15 minute => '0' | 15 minute => '0' |
16 } | 16 } |
17 | 17 |
18 $config = hiera('logrotate::config', {}) | 18 $config = hiera('logrotate::config', {}) |
19 create_resources('logrotate::config', $config) | 19 create_resources('logrotate::config', $config) |
20 } | 20 } |
OLD | NEW |