summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--manifests/base.pp2
-rw-r--r--manifests/cron.pp10
-rw-r--r--manifests/puppetmaster/cleanup_reports.pp4
4 files changed, 12 insertions, 7 deletions
diff --git a/README b/README
index 2063b03..3c71a5f 100644
--- a/README
+++ b/README
@@ -68,6 +68,9 @@ values:
* 'X', where X is the amount of days you want to keep reports for
* false, to disable reports cleanup
+If your reports are in a different place than the default, you can set
+$puppetmaster_reports_dir to adjust their location.
+
Check last run:
---------------
diff --git a/manifests/base.pp b/manifests/base.pp
index 69a7568..695241c 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -6,7 +6,7 @@ class puppet::base {
case $puppet_cleanup_clientbucket {
# if not set, don't do anything
- '': {}
+ '',undef: {}
default: {
tidy { "/var/lib/puppet/clientbucket":
backup => false,
diff --git a/manifests/cron.pp b/manifests/cron.pp
index 9a632ff..f593a00 100644
--- a/manifests/cron.pp
+++ b/manifests/cron.pp
@@ -1,11 +1,13 @@
-# manifests/cron.pp
-
class puppet::cron inherits puppet {
case $operatingsystem {
- linux: { include puppet::cron::linux }
debian: { include puppet::cron::debian }
openbsd: { include puppet::cron::openbsd }
freebsd: { include puppet::cron::freebsd }
- default: { include puppet::cron::base }
+ default: {
+ case $kernel {
+ linux: { include puppet::cron::linux }
+ default: { include puppet::cron::base }
+ }
+ }
}
}
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;
}
}