diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-02-24 14:34:39 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-02-24 14:38:39 -0500 |
commit | 0bb70b28a7c7679d0e07fd75230d40203c0d53b5 (patch) | |
tree | acd91c59fea86768f81d98e262ed1677f646fa47 /manifests/cron/base.pp | |
parent | beae5a608dd1b1d370917896d853a6b53ad73a45 (diff) | |
parent | 8584340c2aeac7d97a78b8303ab377b5049b80c2 (diff) |
Merge branch 'master' of git://git.puppet.immerda.ch/module-puppet
Conflicts:
files/master/config.ru
files/master/puppet.conf
manifests/base.pp
manifests/centos.pp
manifests/cron.pp
manifests/cron/base.pp
manifests/cron/linux.pp
manifests/debian.pp
manifests/init.pp
manifests/linux.pp
manifests/master/linux.pp
manifests/master/package/debian.pp
manifests/puppetmaster/base.pp
manifests/puppetmaster/centos.pp
manifests/puppetmaster/checklastrun.pp
manifests/puppetmaster/checklastrun/disable.pp
manifests/puppetmaster/cleanup_reports.pp
manifests/puppetmaster/cleanup_reports/disable.pp
manifests/puppetmaster/debian.pp
manifests/puppetmaster/package.pp
manifests/puppetmaster/package/base.pp
manifests/puppetmaster/passenger.pp
Diffstat (limited to 'manifests/cron/base.pp')
-rw-r--r-- | manifests/cron/base.pp | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 5c7a708..82483df 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -1,32 +1,47 @@ # manifests/cron/base.pp class puppet::cron::base inherits puppet::base { - + + case $::operatingsystem { + openbsd: { $stop_service = false } + default: { $stop_service = true } + } + + if !$puppet::cron::cron_time { + $crontime_interval_minute = fqdn_rand(29) + $crontime_interval_minute2 = inline_template("<%= 30+scope.lookupvar('puppet::cron::cron_time').to_i %>") + $crontime = "${crontime_interval_minute},${crontime_interval_minute2} * * * *" + } else { + $crontime = $puppet::cron::cron_time + } + + if $puppet::http_compression { + $http_compression_str = '--http_compression' + } else { + $http_compression_str = '' + } + Service['puppet']{ enable => false, } - case $operatingsystem { - openbsd: { - #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 $puppet::cron::stop_service == true { + $puppet_majorversion = regsubst($::puppetversion,'^(\d+\.\d+).*$','\1') + if $puppet_majorversion != '0.25' { + 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'], } } } } + |