
In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix lint errors caught by the puppet-lint-absolute_classname-check gem. Change-Id: Icc120da2373214a9222e9434e725477096e989d3
31 lines
685 B
Puppet
31 lines
685 B
Puppet
# == Define: logrotate::file
|
|
#
|
|
define logrotate::file (
|
|
$log,
|
|
$options,
|
|
$ensure=present,
|
|
$prerotate='undef',
|
|
$postrotate='undef',
|
|
$firstaction='undef',
|
|
$lastaction='undef',
|
|
) {
|
|
|
|
# $options should be an array containing 1 or more logrotate
|
|
# directives (e.g. missingok, compress).
|
|
validate_string($options[0])
|
|
|
|
include ::logrotate
|
|
# This allows us to handle fully pathed files
|
|
$escaped_path = regsubst($name, '/', '_', 'G')
|
|
|
|
file { "/etc/logrotate.d/${escaped_path}":
|
|
ensure => $ensure,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
content => template('logrotate/config.erb'),
|
|
require => File['/etc/logrotate.d'],
|
|
}
|
|
|
|
}
|