summaryrefslogtreecommitdiff
path: root/manifests/puppetmaster/cleanup_reports.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/puppetmaster/cleanup_reports.pp')
-rw-r--r--manifests/puppetmaster/cleanup_reports.pp19
1 files changed, 14 insertions, 5 deletions
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,
+ }
}
}