diff options
author | Micah Anderson <micah@riseup.net> | 2011-03-01 16:12:44 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2011-03-01 16:12:44 -0500 |
commit | d38e7cf64902ff55138e5f85cc7c3b880ea5fb74 (patch) | |
tree | 8ec1b2631301b29088eb6e8c1584cc83832f23a5 /manifests/cron | |
parent | 36ba260d87692847fb5b727fe301e8b3d4988fd3 (diff) |
the debian-specific case doesn't work for squeeze, so re-factor the way it is
done to set a flag so that squeeze has the service stopped, but lenny does not
Diffstat (limited to 'manifests/cron')
-rw-r--r-- | manifests/cron/base.pp | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 7daa6fb..7b40da6 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -1,32 +1,34 @@ # 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, } - 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'], - } + 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'], } } } } + |