Unable to use logrotate puppet forge module

279 views
Skip to first unread message

Jagga Soorma

unread,
Aug 8, 2017, 9:39:13 PM8/8/17
to puppet...@googlegroups.com
Hi Guys,

I am trying to use this logrotate puppet module from the forge
(https://forge.puppet.com/puppet/logrotate) and seems like it updates
my logrotate.conf file without any issues. However, I am now trying
to add a new logrotate.d rule using hiera and it does not do anything
and I was wondering if there is something I am missing. Here is what
it looking like in my yaml file:

--
classes:
- logrotate

# logrotate
logrotate::rule:
'messages':
path: '/var/log/messages'
rotate: 5
rotate_every: 'week'
create: true
create_mode: '0644'
missingok: true
sharedscripts: true
postrotate: '/bin/kill -HUP `cat /var/run/syslogd.pid 2>
/dev/null` 2> /dev/null || true'
--

However puppet agent -t --noop and debug don't see it making any
changes to logrotate.d. Does anyone else on this list have experience
with this specific module? Just wondering what I am missing here.

Thanks in advance for any help with this.

Luke Bigum

unread,
Aug 9, 2017, 4:05:47 AM8/9/17
to Puppet Users
Working backwards from https://github.com/voxpupuli/puppet-logrotate...

create_resources() iscalled to create logrotate::rule resources from a Hash called $rules - https://github.com/voxpupuli/puppet-logrotate/blob/master/manifests/rules.pp

$rules is inherited from the entry Class[logrotate] - https://github.com/voxpupuli/puppet-logrotate/blob/master/manifests/init.pp#L7

There's a typo in hour Hiera key, it should be:

logrotate::rules:

With an "s".

billy subs

unread,
Dec 11, 2018, 7:44:54 PM12/11/18
to Puppet Users
I know its an old post but I just came across this issue...saved me time.....many thanks!

Also, why this module hasnt been updated?!?!?
Reply all
Reply to author
Forward
0 new messages