Added support for removing old puppet reports.

This commit is contained in:
Timo Mkinen 2010-04-17 22:47:12 +03:00
parent aa423ae302
commit b703dd7edc
2 changed files with 20 additions and 0 deletions

View file

@ -110,6 +110,9 @@ class puppet::manual inherits puppet::client {
# Store config type to use. Valid values are "thin", "full" and "none".
# Defaults to "thin".
#
# $puppet_report_maxage:
# Maximum age (in hours) to keep reports. Defaults to 720 hours (30 days).
#
class puppet::server inherits puppet::client {
if ! $puppet_listenports {
@ -245,4 +248,16 @@ class puppet::server inherits puppet::client {
notify => Service["puppetmaster"],
}
if !$puppet_report_maxage {
$puppet_report_maxage = "720"
}
file { "/etc/cron.daily/puppet-report-cleanup":
ensure => present,
content => template("puppet/puppet-report-cleanup.erb"),
mode => 0755,
owner => root,
group => root,
require => File["/srv/puppet/reports"],
}
}

View file

@ -0,0 +1,5 @@
#!/bin/sh
MAXAGE=<%= puppet_report_maxage %>
/usr/sbin/tmpwatch -m ${MAXAGE} /srv/puppet/reports