David Shrewsbury 9a04df09eb Added new logrotate puppet module.
Allows us to easily manage log rotation. Example:

  logrotate::file { 'xyz':
    log => '/var/log/xyz.log',
    options => ['compress', 'weekly'],
  }

Change-Id: I84fa3a20e0510a1273aa9b8555da0dde4613f50a
2012-05-07 16:24:42 -04:00

21 lines
557 B
Puppet

define logrotate::file($log,
$options,
$prerotate='undef',
$postrotate='undef',
$firstaction='undef',
$lastaction='undef') {
# $options should be an array containing 1 or more logrotate
# directives (e.g. missingok, compress).
include logrotate
file { "/etc/logrotate.d/${name}":
owner => root,
group => root,
mode => 644,
content => template("logrotate/config.erb"),
require => File["/etc/logrotate.d"],
}
}