OK… Our puppet master’s disk is slowly filling up with logs… We have around 70+ nodes already so no wonder it’s filling up at a high rate:
I’ve known about the problem since 2 weeks ago but I always had an excuse to put it in my “next” to-do pile….
Well, today I can’t ignore it anymore since it’s almost full 🙂
So off to Google and do a little searching… And this is the best answer that I got:
tidy { "/var/lib/puppet/reports": age => "1w", recurse => true, }
Duh! Use puppet
to clean-up Puppet logs! *facepalm* (I felt stupid when I realized this…)
After knowing a new puppet type, I was excited to do a test run: puppet agent -t
Well… The ruby process ran for a few a minutes but it did nothing! Hmmm… I figured maybe because the number of files is staggering that’s why the puppet run can’t handle it. After all, I have >4GB worth of log files in /var/lib/puppet/reports/
.
So a little help is needed then. I ran these commands to give puppet a hand:
find /var/lib/puppet/reports/ -type f -ctime +7 | xargs -P 4 -n 20 rm -f
And the next succeeding puppet runs worked like a charm 🙂