diff options
-rw-r--r-- | README | 7 | ||||
-rw-r--r-- | manifests/puppetmaster.pp | 7 | ||||
-rw-r--r-- | manifests/puppetmaster/base.pp | 6 | ||||
-rw-r--r-- | manifests/puppetmaster/cleanup_reports.pp | 7 |
4 files changed, 21 insertions, 6 deletions
@@ -24,6 +24,13 @@ In both cases you have to setup the appropriate frontends (apache vhost configuration/nginx vhost configuration) on your own. +By default we clean up reports older than 30 days. If you want to change +that, you can set $puppetmaster_cleanup_reports to one of the following +values: + +* 'X', where X is the amount of days you want to keep reports for +* false, to disable reports cleanup + in your site.pp, i.e. : $puppet_crontime = "0,12 * * * *" diff --git a/manifests/puppetmaster.pp b/manifests/puppetmaster.pp index 5f3ad16..a6d5d77 100644 --- a/manifests/puppetmaster.pp +++ b/manifests/puppetmaster.pp @@ -19,6 +19,13 @@ class puppet::puppetmaster inherits puppet { include puppet::puppetmaster::cluster } + case $puppetmaster_cleanup_reports { + '': { $puppetmaster_cleanup_reports = '30' } + } + + if $puppetmaster_cleanup_reports { + include puppet::puppetmaster::cleanup_reports + } if $use_shorewall { include shorewall::rules::puppet::master diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index a5f7e90..a2bc9d4 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -35,10 +35,4 @@ class puppet::puppetmaster::base inherits puppet::base { notify => Service[puppetmaster], } } - - # clean up reports older than 30 days - file{'/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +30 -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700; - } } diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp new file mode 100644 index 0000000..4d76ceb --- /dev/null +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -0,0 +1,7 @@ +class puppet::puppetmaster::cleanup_reports { + # clean up reports older than $puppetmaster_cleanup_reports days + file{'/etc/cron.daily/puppet_reports_cleanup.sh': + content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700; + } +} |