【发布时间】:2018-06-01 21:38:21
【问题描述】:
我正在尝试使用 puppet 为 logrotate 创建一个测试配置。但似乎我遗漏了一些东西,因为它没有创建旋转文件。 我的要求是如果日志文件超过 x 大小,它应该轮换日志。
下面是人偶代码sn-p。
$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',
}
}
【问题讨论】:
-
这就是我的
logrotate.conf文件的样子compress create dateext nomail noolddir notifempty rotate 4 weekly # configurable file rotations include /etc/logrotate.d -
这些只是变量。您需要某种资源来管理 logrotate 配置文件。
标签: puppet logrotate puppet-enterprise