summaryrefslogtreecommitdiff
path: root/manifests/cron
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/cron')
-rw-r--r--manifests/cron/base.pp46
-rw-r--r--manifests/cron/debian.pp7
-rw-r--r--manifests/cron/linux.pp3
-rw-r--r--manifests/cron/openbsd.pp1
4 files changed, 34 insertions, 23 deletions
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp
index acef55e..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'],
}
}
}
}
+
diff --git a/manifests/cron/debian.pp b/manifests/cron/debian.pp
new file mode 100644
index 0000000..0b4bd61
--- /dev/null
+++ b/manifests/cron/debian.pp
@@ -0,0 +1,7 @@
+class puppet::cron::debian inherits puppet::cron::linux {
+
+ File['/etc/cron.d/puppetd.cron']{
+ path => '/etc/cron.d/puppetd',
+ }
+
+}
diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp
index a5008bf..bab9564 100644
--- a/manifests/cron/linux.pp
+++ b/manifests/cron/linux.pp
@@ -1,5 +1,6 @@
# manifests/cron/linux.pp
class puppet::cron::linux inherits puppet::linux {
+
include puppet::cron::base
if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' }
if $puppet_http_compression { $puppet_http_compression_str = '--http_compression' }
@@ -13,7 +14,7 @@ class puppet::cron::linux inherits puppet::linux {
File['/etc/cron.d/puppetd.cron']{
source => undef,
- content => "# run puppet\n$puppet_crontime root /usr/sbin/puppetd --onetime --no-daemonize --config=$puppet_config --color false $puppet_http_compression_str | grep -E '(^err:|^alert:|^emerg:|^crit:)'\n",
+ 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'],
}
}
diff --git a/manifests/cron/openbsd.pp b/manifests/cron/openbsd.pp
index 4ee293f..084b022 100644
--- a/manifests/cron/openbsd.pp
+++ b/manifests/cron/openbsd.pp
@@ -1,4 +1,5 @@
class puppet::cron::openbsd inherits puppet::openbsd {
+
include puppet::cron::base
if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' }
if $puppet_http_compression { $puppet_http_compression_str = '--http_compression' }