voxpupuli / puppet-logrotate

Puppet logrotate module
https://forge.puppet.com/puppet/logrotate
MIT License
26 stars 93 forks source link

copytruncate => true affects logrotate::defaults wtmp and btmp rules #22

Closed jurim76 closed 6 years ago

jurim76 commented 8 years ago

Steps to reproduce:

Define logrotate rule with copytruncate => true logrotate::rule { 'bareos-dir': ensure => 'present', path => '/var/log/bareos/bareos.log', copytruncate => true, rotate_every => 'day', }

Run puppet agent: puppet agent -t --noop

Notice: /Stage[main]/Logrotate::Defaults/Logrotate::Rule[wtmp]/File[/etc/logrotate.d/wtmp]/content: --- /etc/logrotate.d/wtmp 2016-04-08 11:49:03.350782866 +0300 +++ /tmp/puppet-file20160408-4361-1nbhprz 2016-04-08 11:49:31.387484499 +0300 @@ -3,6 +3,7 @@

/var/log/wtmp { compress

Info: Computing checksum on file /etc/logrotate.d/wtmp Info: FileBucket got a duplicate file {md5}4e976492b3888ef9e041defbe44ae52b Info: /Stage[main]/Logrotate::Defaults/Logrotate::Rule[wtmp]/File[/etc/logrotate.d/wtmp]: Filebucketed /etc/logrotate.d/wtmp to puppet with sum 4e976492b3888ef9e041defbe44ae52b Notice: /Stage[main]/Logrotate::Defaults/Logrotate::Rule[wtmp]/File[/etc/logrotate.d/wtmp]/content: content changed '{md5}4e976492b3888ef9e041defbe44ae52b' to '{md5}5a286514899ec18d6604f510314014e2' Notice: /Stage[main]/Logrotate::Defaults/Logrotate::Rule[btmp]/File[/etc/logrotate.d/btmp]/content: --- /etc/logrotate.d/btmp 2016-04-08 11:49:16.011099676 +0300 +++ /tmp/puppet-file20160408-4361-1xiiqap 2016-04-08 11:49:31.443485900 +0300 @@ -3,6 +3,7 @@

/var/log/btmp { compress

juniorsysadmin commented 6 years ago

Likely fixed by #38