diff options
Diffstat (limited to 'manifests/cron')
-rw-r--r-- | manifests/cron/base.pp | 46 | ||||
-rw-r--r-- | manifests/cron/linux.pp | 1 |
2 files changed, 23 insertions, 24 deletions
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 7b40da6..7daa6fb 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -1,34 +1,32 @@ # manifests/cron/base.pp class puppet::cron::base inherits puppet::base { - - case $operatingsystem { - debian: { if $lsbdistcodename != 'lenny' { $stop_service = true } else { $stop_service = false } } - openbsd, ubuntu: { $stop_service = false } - default: { $stop_service = true } - } - + Service['puppet']{ enable => false, } - if $stop_service == true { - $puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1') - if $puppet_majorversion == '2.6' { - Service['puppet']{ - ensure => stopped, - } - } else { - Service['puppet']{ - hasstatus => false, - pattern => 'puppetd', - } - # this works only on < 2.6 - exec { 'stop_puppet': - command => 'kill `cat /var/run/puppet/puppetd.pid`', - onlyif => 'test -f /var/run/puppet/puppetd.pid', - require => Service['puppet'], + case $operatingsystem { + debian,openbsd,ubuntu: { + #it's already disabled + } + default: { + $puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1') + if $puppet_majorversion == '2.6' { + Service['puppet']{ + ensure => stopped, + } + } else { + Service['puppet']{ + hasstatus => false, + pattern => 'puppetd', + } + # this works only on < 2.6 + 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 bab9564..5003559 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -16,5 +16,6 @@ class puppet::cron::linux inherits puppet::linux { source => undef, content => "#run puppet\n$puppet_crontime root output=\$(/usr/sbin/puppetd --onetime --no-daemonize --splay --config=/etc/puppet/puppet.conf --color false); ret=\$?; printf \"\\%s\" \"\$output\" | grep -E '(^err:|^alert:|^emerg:|^crit:)'; exit \$ret\n", before => Service['puppet'], + ensure => present } } |