Ask Your Question
0

How to keep the logrotate.conf unchanged?

asked 2018-05-18 06:58:53 -0500

Hi,

I am using "voxpupuli/puppet-logrotate" module to create new rules for logrotate.d/syslog, but I want to keep the original lograotate.conf from rpm. The problem is that whenever I run puppet, it changes the logrotate.conf. How can I stop puppet changing the conf file?

I have tried to check if the file already exists (eg. below), but it did not help.

  file { '/etc/logrotate.conf':
    ensure  => 'present',
    replace => 'no',
    mode    => '0644',
}

Is there any other way to do it?

Thanks in advance,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-18 17:24:25 -0500

binford2k gravatar image

Generally speaking, most configuration solutions will replace a configuration file with a known version. That way, you always know what the end result is, leaving you in a safer and more repeatable state. That module does exactly that.

What you'll want to do is replicate the parts of the config file you actually care about in Puppet code and then let that module just own the file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-18 06:58:53 -0500

Seen: 13 times

Last updated: May 18