From 45acc8df306666f1eaa033e519b24e261dcca7b0 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:10:46 +0200 Subject: Inherit from the right base class. --- manifests/puppetmaster/package/debian.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 33d7d5e..39feced 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,4 +1,4 @@ -class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package { +class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { Package['puppetmaster']{ require => Package['puppetmaster-common'] -- cgit v1.2.3 From f37df509cf1ea3edafd4e60eaa349add9ae19e63 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:15:34 +0200 Subject: Install puppetmaster-common package. This should fix the remaining issues from https://labs.riseup.net/code/issues/2928 --- manifests/puppetmaster/package/debian.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 39feced..9d7d397 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,5 +1,9 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { + package { 'puppetmaster-common': + ensure => present, + } + Package['puppetmaster']{ require => Package['puppetmaster-common'] } -- cgit v1.2.3 From 34fbca2af14bfc3bda4641c6c36e144d5229f8c1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:37:08 +0200 Subject: Fix probable typos. --- manifests/puppetmaster/base.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index 6ac1e0c..25709ea 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -20,7 +20,7 @@ class puppet::puppetmaster::base inherits puppet::base { if $puppetmaster_mode == 'passenger' { - include puppet::puppetmaster::pasenger + include puppet::puppetmaster::passenger File[$puppet_fileserverconfig]{ notify => Exec['notify_passenger_puppetmaster'], } -- cgit v1.2.3 From 0f4718f062f7419092f69dcdd951339a466a79b8 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 00:52:08 +0200 Subject: migrate cleanup_reports to parametrized classes as this makes it much more configurable --- manifests/puppetmaster/cleanup_reports.pp | 19 ++++++++++++++----- manifests/puppetmaster/cleanup_reports/disable.pp | 6 ------ 2 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 manifests/puppetmaster/cleanup_reports/disable.pp (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index 664bd81..d25e8ac 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,8 +1,17 @@ -class puppet::puppetmaster::cleanup_reports { +class puppet::puppetmaster::cleanup_reports( + $cleanup_older_than = 'absent', + $reports_dir = '/var/lib/puppet/reports/' +){ + file { '/etc/cron.daily/puppet_reports_cleanup.sh': } - # clean up reports older than $puppetmaster_cleanup_reports days - file { '/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700; + if $cleanup_older_than != 'absent' { + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700, + } + } else { + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + ensure => absent, + } } } diff --git a/manifests/puppetmaster/cleanup_reports/disable.pp b/manifests/puppetmaster/cleanup_reports/disable.pp deleted file mode 100644 index 8636223..0000000 --- a/manifests/puppetmaster/cleanup_reports/disable.pp +++ /dev/null @@ -1,6 +0,0 @@ -class puppet::puppetmaster::cleanup_reports::disable inherits puppet::puppetmaster::cleanup_reports { - - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - ensure => absent, - } -} -- cgit v1.2.3 From 0fd0df89f4a0bd0700b3260a4c40041c59f65660 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:04:20 +0200 Subject: fix variable naming --- manifests/puppetmaster/cleanup_reports.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d25e8ac..d9bd2ca 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -6,7 +6,7 @@ class puppet::puppetmaster::cleanup_reports( if $cleanup_older_than != 'absent' { File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_older_than} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700, } } else { -- cgit v1.2.3 From 551b46b257b12b32450607083a7cd644ed0dff58 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:21:00 +0200 Subject: Revert "fix variable naming" This reverts commit 0fd0df89f4a0bd0700b3260a4c40041c59f65660. --- manifests/puppetmaster/cleanup_reports.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d9bd2ca..d25e8ac 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -6,7 +6,7 @@ class puppet::puppetmaster::cleanup_reports( if $cleanup_older_than != 'absent' { File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_older_than} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700, } } else { -- cgit v1.2.3 From 9a18424b2bdf3506737a28ca56a25e20950d6d68 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:21:06 +0200 Subject: Revert "migrate cleanup_reports to parametrized classes as this makes it much more configurable" This reverts commit 0f4718f062f7419092f69dcdd951339a466a79b8. Unfortuantely due to puppet bug #5517 we currently can't do it that nice so we need to hack around things https://projects.puppetlabs.com/issues/5517 --- manifests/puppetmaster/cleanup_reports.pp | 19 +++++-------------- manifests/puppetmaster/cleanup_reports/disable.pp | 6 ++++++ 2 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 manifests/puppetmaster/cleanup_reports/disable.pp (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d25e8ac..664bd81 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,17 +1,8 @@ -class puppet::puppetmaster::cleanup_reports( - $cleanup_older_than = 'absent', - $reports_dir = '/var/lib/puppet/reports/' -){ - file { '/etc/cron.daily/puppet_reports_cleanup.sh': } +class puppet::puppetmaster::cleanup_reports { - if $cleanup_older_than != 'absent' { - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700, - } - } else { - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - ensure => absent, - } + # clean up reports older than $puppetmaster_cleanup_reports days + file { '/etc/cron.daily/puppet_reports_cleanup.sh': + content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700; } } diff --git a/manifests/puppetmaster/cleanup_reports/disable.pp b/manifests/puppetmaster/cleanup_reports/disable.pp new file mode 100644 index 0000000..8636223 --- /dev/null +++ b/manifests/puppetmaster/cleanup_reports/disable.pp @@ -0,0 +1,6 @@ +class puppet::puppetmaster::cleanup_reports::disable inherits puppet::puppetmaster::cleanup_reports { + + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + ensure => absent, + } +} -- cgit v1.2.3 From b3dc59ba25d05529936736297334ce86b402445f Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:24:29 +0200 Subject: implement setting reports cleanup dir the old way --- manifests/puppetmaster/cleanup_reports.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index 664bd81..005a4d7 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,8 +1,8 @@ class puppet::puppetmaster::cleanup_reports { - + case $puppetmaster_reports_dir { '',undef: { $puppetmaster_reports_dir = '/var/lib/puppet/reports' } } # clean up reports older than $puppetmaster_cleanup_reports days file { '/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppetmaster_reports_dir} -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700; } } -- cgit v1.2.3