From 923304d7b5b6f05df161e0c388d61c9b0b98c210 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Jan 2013 13:44:21 +0100 Subject: linted checklastrun.pp --- manifests/puppetmaster/checklastrun.pp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index 93ed8b9..f89edd0 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -1,25 +1,29 @@ 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}" } 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', } } -- cgit v1.2.3 From 5660f23abd0013a9f967df184e30dc9b2da3eeb3 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Jan 2013 13:57:27 +0100 Subject: linted linux.pp --- manifests/linux.pp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/manifests/linux.pp b/manifests/linux.pp index 13788ef..b46ad70 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -13,12 +13,14 @@ class puppet::linux inherits puppet::base { Service['puppet']{ require => Package[puppet], } - + 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 + ensure => absent, + 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' } } -- cgit v1.2.3 From e07669af9f03b2a24db4e907566da8780b775981 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Jan 2013 14:14:13 +0100 Subject: removed unnesseccary stuff for absent puppetd.cron --- manifests/linux.pp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/manifests/linux.pp b/manifests/linux.pp index b46ad70..b2359d2 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -15,12 +15,6 @@ class puppet::linux inherits puppet::base { } file { '/etc/cron.d/puppetd.cron': - ensure => absent, - 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 } } -- cgit v1.2.3 From 2a98b04c08087fc27fea067861c3e4fa08af36a7 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Jan 2013 14:21:59 +0100 Subject: linted cron/linux.pp --- manifests/cron/linux.pp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp index 5003559..33a4535 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -1,11 +1,12 @@ -# 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 %>') @@ -13,9 +14,9 @@ class puppet::cron::linux inherits puppet::linux { } 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 + 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 } } -- cgit v1.2.3 From 18b8da26f9ed976ccb908000014a275899797567 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Jan 2013 14:23:41 +0100 Subject: added service dependency for cron --- manifests/cron/linux.pp | 3 ++- manifests/puppetmaster/checklastrun.pp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp index 33a4535..263dc3f 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -17,6 +17,7 @@ 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 + ensure => present, + notify => service['cron'] } } diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index f89edd0..b57ec05 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -25,5 +25,6 @@ class puppet::puppetmaster::checklastrun { owner => root, group => 0, mode => '0644', + notify => service['cron'] } } -- cgit v1.2.3 From 413b964ec31f9eb6035ecb4c5e38a90f1eee596f Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 2 Jan 2013 10:39:48 -0500 Subject: cron service dependancy has some errors and misses the cron class Signed-off-by: Gabriel Filion --- manifests/cron/linux.pp | 4 +++- manifests/puppetmaster/checklastrun.pp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp index 263dc3f..e00b4d0 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -13,11 +13,13 @@ class puppet::cron::linux inherits puppet::linux { $puppet_crontime = "${puppet_crontime_interval_minute},${puppet_crontime_interval_minute2} * * * *" } + include ::cron + 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, - notify => service['cron'] + notify => Service['cron'] } } diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index b57ec05..5a1b1c8 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -12,6 +12,8 @@ class puppet::puppetmaster::checklastrun { default => "--timeout ${::puppet_lastruncheck_timeout}" } + include ::cron + file{ '/usr/local/sbin/puppetlast': source => [ 'puppet:///modules/puppet/master/lastruncheck' ], @@ -25,6 +27,6 @@ class puppet::puppetmaster::checklastrun { owner => root, group => 0, mode => '0644', - notify => service['cron'] + notify => Service['cron'] } } -- cgit v1.2.3 From 87b8cf7133beb4c9dd6f6e7692d374d302f8ea5a Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 2 Jan 2013 11:26:56 -0500 Subject: Make all linux distributions use the same path for the cron file This simplifies the hierarchy and fixes the problem that going from puppet::cron to puppet under debian doesn't remove the cron file. Signed-off-by: Gabriel Filion --- manifests/cron.pp | 3 +-- manifests/cron/debian.pp | 7 ------- manifests/cron/linux.pp | 2 +- manifests/linux.pp | 4 ++++ 4 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 manifests/cron/debian.pp diff --git a/manifests/cron.pp b/manifests/cron.pp index 9a632ff..644475e 100644 --- a/manifests/cron.pp +++ b/manifests/cron.pp @@ -2,8 +2,7 @@ class puppet::cron inherits puppet { case $operatingsystem { - linux: { include puppet::cron::linux } - debian: { include puppet::cron::debian } + linux,debian,ubuntu: { include puppet::cron::linux } openbsd: { include puppet::cron::openbsd } freebsd: { include puppet::cron::freebsd } default: { include puppet::cron::base } 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 e00b4d0..f5b0ebb 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -15,7 +15,7 @@ class puppet::cron::linux inherits puppet::linux { include ::cron - File['/etc/cron.d/puppetd.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'], diff --git a/manifests/linux.pp b/manifests/linux.pp index b2359d2..e752788 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -14,6 +14,10 @@ class puppet::linux inherits puppet::base { 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': ensure => absent } -- cgit v1.2.3