Skip to content

puppet/master: Decrease reports retention time

Guillaume Samson requested to merge puppet_reports_retention into production

Since this morning the disk space alert on pergamon is critical:

root@pergamon:~# df -hT /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/vda1      ext4   50G   43G  4.5G  91% /

The puppet reports take up a lot of space:

root@pergamon:~# du -sh /var/lib/puppet/reports/
12G     /var/lib/puppet/reports/

The actual retention time for these reports is one month.
This modification will set up this retention time to 7 days.

Octocatalog diff
Found host pergamon.softwareheritage.org
Cloning into '/tmp/swh-ocd.aEg9c9SK/swh-site'...
done.
branch 'puppet_reports_retention' set up to track 'origin/puppet_reports_retention'.
Switched to a new branch 'puppet_reports_retention'
branch 'mr/puppet-7-compat' set up to track 'origin/mr/puppet-7-compat'.
Switched to a new branch 'mr/puppet-7-compat'
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
Auto-merging Puppetfile
[production c765176f] WIP: Update Puppetfile for compatibility with Puppet 7
 Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
 Date: Mon Nov 28 14:17:01 2022 +0100
 1 file changed, 7 insertions(+), 1 deletion(-)
Switched to branch 'puppet_reports_retention'
Your branch is up to date with 'origin/puppet_reports_retention'.
Auto-merging Puppetfile
[puppet_reports_retention c1971c49] WIP: Update Puppetfile for compatibility with Puppet 7
 Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
 Date: Mon Nov 28 14:17:01 2022 +0100
 1 file changed, 7 insertions(+), 1 deletion(-)
WARN     -> Branch mr/puppet-7-compat filtered out by ignore_branch_prefixes ["mr/puppet-7-compat"]
WARN     -> Branch mr/puppet-7-compat filtered out by ignore_branch_prefixes ["mr/puppet-7-compat"]
Cloning into '/tmp/swh-ocd.aEg9c9SK/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.aEg9c9SK/environments/puppet_reports_retention/data/private'...
done.
*** Running octocatalog-diff on host pergamon.softwareheritage.org
I, [2023-12-19T10:45:45.982920 #142321]  INFO -- : Catalogs compiled for pergamon.softwareheritage.org
W, [2023-12-19T10:45:46.933818 #142321]  WARN -- : Resource File[/tmp/ocd-ipc-20231219-142321-74gzse/ocd-builddir-20231219-142324-goznnm/routes.yaml] appears to depend on catalog compilation directory. Suppressed from results.
W, [2023-12-19T10:45:46.933883 #142321]  WARN -- : Resource File[/tmp/ocd-ipc-20231219-142321-74gzse/ocd-builddir-20231219-142323-goznnm/routes.yaml] appears to depend on catalog compilation directory. Suppressed from results.
W, [2023-12-19T10:45:46.933999 #142321]  WARN -- : Resource key Ini_setting[puppetdbserver_urls] parameters => path may depend on catalog compilation directory, but there may be differences. This is included in results for now, but please verify.
W, [2023-12-19T10:45:46.934012 #142321]  WARN -- : Resource key Ini_setting[puppetdbserver_urls] parameters => path appears to depend on catalog compilation directory. Suppressed from results.
W, [2023-12-19T10:45:46.934039 #142321]  WARN -- : Resource key Ini_setting[soft_write_failure] parameters => path may depend on catalog compilation directory, but there may be differences. This is included in results for now, but please verify.
W, [2023-12-19T10:45:46.934047 #142321]  WARN -- : Resource key Ini_setting[soft_write_failure] parameters => path appears to depend on catalog compilation directory. Suppressed from results.
I, [2023-12-19T10:45:46.934131 #142321]  INFO -- : Diffs computed for pergamon.softwareheritage.org
diff origin/production/pergamon.softwareheritage.org current/pergamon.softwareheritage.org
*******************************************
  Concat_fragment[profile::cron::purge-puppet-reports] =>
   parameters =>
     content =>
      @@ -1,2 +1,2 @@
       # Cron snippet purge-puppet-reports
      -24 22 * * * root find /var/lib/puppet/reports -type f -mtime +30 -delete
      +24 22 * * * root find /var/lib/puppet/reports -type f -mtime +7 -delete
*******************************************
  File[/etc/bind/keys/local-update] =>
   parameters =>
     content =>
      @@ -2,4 +2,4 @@
       key local-update {
        algorithm hmac-sha256;
      - secret "xxx";
      + secret "xxx";
       };
*******************************************
  File[/etc/bind/rndc.key] =>
   parameters =>
     content =>
      @@ -2,4 +2,4 @@
       key rndc-key {
        algorithm hmac-md5;
      - secret "xxx";
      + secret "xxx";
       };
*******************************************
  Profile::Cron::D[purge-puppet-reports] =>
   parameters =>
     command =>
      - find /var/lib/puppet/reports -type f -mtime +30 -delete
      + find /var/lib/puppet/reports -type f -mtime +7 -delete
*******************************************
*** End octocatalog-diff on pergamon.softwareheritage.org

Merge request reports