I am trying to create a test config for logrotate using puppet. But it seems like I am missing something as it is not creating the rotated file. My requirement is if the logfile exceeds x amount of size, it should rotate the log.
Below is the puppet code snippet.
$conf_params = {
dateext => true,
compress => true,
ifempty => false,
mail => false,
olddir => false,
}
$configdir = '/etc'
$root_group = 'root'
$logrotate_bin = '/usr/sbin/logrotate'
$base_rules = {
'test' => {
path => '/root/test/logs/test.log'
create_mode => '0775',
copytruncate => true,
size => '10M',
},
}
$rule_default = {
missingok => true,
create => true,
size => '10M',
create_owner => 'root',
create_group => 'root',
}
}