Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Clean puppet reports #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davidoae
Copy link
Contributor

@davidoae davidoae commented Jun 4, 2015

We're keeping puppet run logs for ever and they use space and we don't need them so this sets a cronjob to remove puppet reports older than 30 days.

cron { 'clean-puppet-reports':
ensure => present,
command => "find $(awk -F= '/^reportdir/ { print $2 }' /etc/puppet/puppet.conf) -type f -iname \*.yaml -ctime +30 -delete",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this directory be defaulted to /var/lib/puppet/reports somehow? The QA pupper server doesn't seem to configure a reportdir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started there, but in production the reports are in /data/puppet/reports, hence the awk. I didn't check qa.
Honestly this is such a minor thing that I should just add the reportdir config into qa's puppet.conf.
I only noticed this issue 'cos puppet in staging is almost out of space, mostly these reports :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need to add reportdir to puppmaster provision script too.

@simong
Copy link
Contributor

simong commented Jun 4, 2015

Back to @davidoae for follow-up

@simong simong assigned davidoae and unassigned simong Jun 4, 2015
@mrvisser
Copy link
Contributor

mrvisser commented Jun 4, 2015

Just a caution that we do in fact have a cronjob on the production puppet master that does this:

0 1 * * * find /data/puppet/reports -name "*.yaml" -mtime +10 -exec rm -f {} \;

However it's not managed by puppet, but it should. So be sure to remove the unmanaged one when deploying.

Thanks for moving this forward!

@davidoae
Copy link
Contributor Author

davidoae commented Jun 4, 2015

Thanks dude, I completely missed that one heh.

On 4 June 2015 at 12:49, Branden Visser [email protected] wrote:

Just a caution that we do in fact have a cronjob on the production puppet
master that does this:

0 1 * * * find /data/puppet/reports -name "*.yaml" -mtime +10 -exec rm -f
{} ;

However it's not managed by puppet, but it should. So be sure to remove
the unmanaged one when deploying.

Thanks for moving this forward!


Reply to this email directly or view it on GitHub
#158 (comment)
.

@davidoae davidoae assigned simong and unassigned davidoae Jun 18, 2015
@davidoae
Copy link
Contributor Author

I have added the change to provision script.
The cron that's currently in place I'll remove manually after merge.
I've added reportdir to qa's puppet.conf so merge shouldn't break qa.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants