[Pkg-puppet-devel] Bug#930033: Bug#930033: Puppet-master do not clean reports in /var/lib/puppet/reports

micah anderson micah at riseup.net
Wed Jun 5 17:23:41 BST 2019


Thomas Goirand <zigo at debian.org> writes:

> Using puppet-master from both Stretch and Buster in production, I have found
> out that on each puppet run, a run report is saved under:
>
> /var/lib/puppet/reports/<HOSTNAME>/<DATE>.yaml
>
> unfortunately, with a moderatly sized cluster (about 30 nodes), this fills-up
> very fast. For me, the reports folder was 52 GBytes, leading to a disk full
> (as my puppet-master was running on a small-ish VM). Of course, once the
> disk is full, absolutely nothing works anymore (new nodes get their certs
> saved as zero bytes, etc.).
>
> What should be done, is clean old reports, let's say those that are at least
> one month old, using a cron.daily job.

Some people want these reports to continue to accumulate, some do not,
this is what I do:

 class puppet::master::cleanup_reports {
  # clean up reports older than $puppetmaster_cleanup_reports days
  file { '/etc/cron.daily/puppet_reports_cleanup':
    content => "#!/bin/bash\nfind ${puppet::master::reports_dir} -maxdepth 2 -type f -ctime +${puppet::master::cleanup_reports} -exec rm {} \\;\n",
    owner   => root,
    group   => 0,
    mode    => '0700';
  }

-- 
        micah



More information about the Pkg-puppet-devel mailing list