summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2013-01-02 12:14:12 -0500
committerGabriel Filion <lelutin@gmail.com>2013-01-02 12:14:12 -0500
commit560b7c829e8ec043cf603fd6b1e2a1d3e0946a63 (patch)
tree420db02979146e6c14cf57701e1541e7b97649df
parentaaf7ffad90958aff6e068c0496bd5f91e8759e4d (diff)
parent87b8cf7133beb4c9dd6f6e7692d374d302f8ea5a (diff)
Merge branch 'puppet_cron'
Conflicts: manifests/cron.pp manifests/linux.pp take the changes from puppet_cron
-rw-r--r--manifests/cron.pp2
-rw-r--r--manifests/cron/debian.pp7
-rw-r--r--manifests/cron/linux.pp20
-rw-r--r--manifests/linux.pp10
-rw-r--r--manifests/puppetmaster/checklastrun.pp31
5 files changed, 37 insertions, 33 deletions
diff --git a/manifests/cron.pp b/manifests/cron.pp
index f593a00..8cb4644 100644
--- a/manifests/cron.pp
+++ b/manifests/cron.pp
@@ -1,6 +1,6 @@
class puppet::cron inherits puppet {
case $operatingsystem {
- debian: { include puppet::cron::debian }
+ debian,ubuntu: { include puppet::cron::linux }
openbsd: { include puppet::cron::openbsd }
freebsd: { include puppet::cron::freebsd }
default: {
diff --git a/manifests/cron/debian.pp b/manifests/cron/debian.pp
deleted file mode 100644
index 0b4bd61..0000000
--- a/manifests/cron/debian.pp
+++ /dev/null
@@ -1,7 +0,0 @@
-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 5003559..f5b0ebb 100644
--- a/manifests/cron/linux.pp
+++ b/manifests/cron/linux.pp
@@ -1,21 +1,25 @@
-# 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' }
+ if $::puppet_http_compression {
+ $puppet_http_compression_str = '--http_compression'
+ }
+
-
if !$puppet_crontime {
$puppet_crontime_interval_minute = fqdn_rand(29)
$puppet_crontime_interval_minute2 = inline_template('<%= 30+puppet_crontime_interval_minute.to_i %>')
$puppet_crontime = "${puppet_crontime_interval_minute},${puppet_crontime_interval_minute2} * * * *"
}
- File['/etc/cron.d/puppetd.cron']{
- 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
+ include ::cron
+
+ File['/etc/cron.d/puppetd']{
+ 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,
+ notify => Service['cron']
}
}
diff --git a/manifests/linux.pp b/manifests/linux.pp
index d17b386..e752788 100644
--- a/manifests/linux.pp
+++ b/manifests/linux.pp
@@ -13,12 +13,12 @@ class puppet::linux inherits puppet::base {
Service['puppet']{
require => Package[puppet],
}
-
+
+ file { '/etc/cron.d/puppetd':
+ ensure => absent
+ }
+ # For backwards compatibility, remove this so that the cron is not duplicated
file { '/etc/cron.d/puppetd.cron':
- source => [ "puppet:///modules/site_puppet/cron.d/puppetd",
- "puppet:///modules/puppet/cron.d/puppetd.${operatingsystem}",
- "puppet:///modules/puppet/cron.d/puppetd" ],
- owner => root, group => 0, mode => 0644,
ensure => absent
}
}
diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp
index 93ed8b9..5a1b1c8 100644
--- a/manifests/puppetmaster/checklastrun.pp
+++ b/manifests/puppetmaster/checklastrun.pp
@@ -1,25 +1,32 @@
class puppet::puppetmaster::checklastrun {
- $puppet_lastruncheck_ignorehosts_str = $puppet_lastruncheck_ignorehosts ? {
- '' => '',
- undef => '',
- default => "--ignore-hosts ${puppet_lastruncheck_ignorehosts}"
+ $puppet_lastruncheck_ignorehosts_str = $::puppet_lastruncheck_ignorehosts ? {
+ '' => '',
+ undef => '',
+ default => "--ignore-hosts ${::puppet_lastruncheck_ignorehosts}"
}
- $puppet_lastruncheck_timeout_str = $puppet_lastruncheck_timeout ? {
- '' => '',
- undef => '',
- default => "--timeout ${puppet_lastruncheck_timeout}"
+ $puppet_lastruncheck_timeout_str = $::puppet_lastruncheck_timeout ? {
+ '' => '',
+ undef => '',
+ default => "--timeout ${::puppet_lastruncheck_timeout}"
}
+ include ::cron
+
file{
'/usr/local/sbin/puppetlast':
- source => [ "puppet:///modules/puppet/master/lastruncheck" ],
- owner => root, group => 0, mode => 0700;
+ source => [ 'puppet:///modules/puppet/master/lastruncheck' ],
+ owner => root,
+ group => 0,
+ mode => '0700';
'/etc/cron.d/puppetlast.cron':
content => "${puppetmaster_lastruncheck_cron} root /usr/local/sbin/puppetlast ${puppet_lastruncheck_timeout_str} ${puppet_lastruncheck_ignorehosts_str} ${$puppet_lastruncheck_additionaloptions}\n",
- require => File["/usr/local/sbin/puppetlast"],
- owner => root, group => 0, mode => 0644,
+ require => File['/usr/local/sbin/puppetlast'],
+ owner => root,
+ group => 0,
+ mode => '0644',
+ notify => Service['cron']
}
}