diff options
Diffstat (limited to 'manifests/cron')
-rw-r--r-- | manifests/cron/base.pp | 32 | ||||
-rw-r--r-- | manifests/cron/linux.pp | 22 | ||||
-rw-r--r-- | manifests/cron/openbsd.pp | 34 |
3 files changed, 40 insertions, 48 deletions
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 6688c5e..2289a3c 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -1,23 +1,23 @@ # manifests/cron/base.pp class puppet::cron::base inherits puppet::base { - Service['puppet']{ - enable => false, - } + Service['puppet']{ + enable => false, + } - case $operatingsystem { - debian,openbsd,ubuntu: { - #it's already disabled - } - default: { - Service['puppet']{ - hasstatus => false, - } - } + case $operatingsystem { + debian,openbsd,ubuntu: { + #it's already disabled } - exec{'stop_puppet': - command => 'kill `cat /var/run/puppet/puppetd.pid`', - onlyif => 'test -f /var/run/puppet/puppetd.pid', - require => Service['puppet'], + default: { + Service['puppet']{ + hasstatus => false, + } } + } + exec{'stop_puppet': + command => 'kill `cat /var/run/puppet/puppetd.pid`', + onlyif => 'test -f /var/run/puppet/puppetd.pid', + require => Service['puppet'], + } } diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp index 75f11a3..c13c10a 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -1,18 +1,12 @@ # manifests/cron/linux.pp class puppet::cron::linux inherits puppet::linux { - include puppet::cron::base - case $puppet_config { - '': { $puppet_config = '/etc/puppet/puppet.conf' } - } - - case $puppet_crontime { - '': { $puppet_crontime = '0,30 * * * *' } - } + include puppet::cron::base + if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' } + + if !$puppet_crontime { $puppet_crontime = '0,30 * * * *' } - - File['/etc/cron.d/puppetd.cron']{ - source => undef, - content => "# run puppet -$puppet_crontime root /usr/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'\n", - } + File['/etc/cron.d/puppetd.cron']{ + source => undef, + content => "# run puppet\n$puppet_crontime root /usr/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'\n", + } } diff --git a/manifests/cron/openbsd.pp b/manifests/cron/openbsd.pp index f10fa24..5565fbb 100644 --- a/manifests/cron/openbsd.pp +++ b/manifests/cron/openbsd.pp @@ -1,22 +1,20 @@ class puppet::cron::openbsd inherits puppet::openbsd { - include puppet::cron::base - case $puppet_config { - '': { $puppet_config = '/etc/puppet/puppet.conf' } - } - Openbsd::Rc_local['puppetd']{ - ensure => 'absent', - } - Cron['puppetd_check']{ - ensure => absent, - } - Cron['puppetd_restart']{ - ensure => absent, - } + include puppet::cron::base + if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' } - cron { 'puppetd_run': - command => "/usr/local/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'", - user => 'root', - minute => [0,30], - } + Openbsd::Rc_local['puppetd']{ + ensure => 'absent', + } + Cron['puppetd_check']{ + ensure => absent, + } + Cron['puppetd_restart']{ + ensure => absent, + } + cron { 'puppetd_run': + command => "/usr/local/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'", + user => 'root', + minute => [0,30], + } } |