Staging instance, all changes can be removed at any time

Skip to content

rancher: Deploy etcd snapshots cleaning cron job

Guillaume Samson requested to merge rancher_retention_cleaning into production

Related to swh/infra/sysadm-environment#4680 (closed)

This modifications will deploy a bash script and a CRON job on all the mgmt1 clusters.
These script and job already run on all clusters since 2 days to ensure that the sensitive Rancher snapshots mechanism support it.
In the current cron job file I added a PATH variable (PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin) to be sure that rke2 is found (/usr/local/bin/rke2).
This will probably be erased.

Octocatalog-diff
ᐅ bin/octocatalog-diff -f production -t rancher_retention_cleaning rancher-node-production-rke2-mgmt1
Found host rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
Cloning into '/tmp/swh-ocd.suxmDZlw/swh-site'...
done.
branch 'rancher_retention_cleaning' set up to track 'origin/rancher_retention_cleaning'.
Switched to a new branch 'rancher_retention_cleaning'
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 5668a0c6] 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 'rancher_retention_cleaning'
Your branch is up to date with 'origin/rancher_retention_cleaning'.
Auto-merging Puppetfile
[rancher_retention_cleaning eb127a49] 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.suxmDZlw/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.suxmDZlw/environments/rancher_retention_cleaning/data/private'...
done.
*** Running octocatalog-diff on host rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
I, [2024-07-25T17:37:24.481775 #722735]  INFO -- : Catalogs compiled for rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
I, [2024-07-25T17:37:24.664993 #722735]  INFO -- : Diffs computed for rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
diff origin/production/rancher-node-production-rke2-mgmt1.internal.softwareheritage.org current/rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
*******************************************
+ Concat_file[profile::cron::etcd-snapshots-cleaning] =>
   parameters =>
     "group": "root",
     "mode": "0644",
     "owner": "root",
     "path": "/etc/puppet-cron.d/etcd-snapshots-cleaning",
     "tag": "profile::cron::etcd-snapshots-cleaning"
*******************************************
+ Concat_fragment[profile::cron::etcd-snapshots-cleaning::_header] =>
   parameters =>
     "content": "# Managed by puppet (module profile::cron), manual changes will ...
     "order": "00",
     "tag": "profile::cron::etcd-snapshots-cleaning",
     "target": "profile::cron::etcd-snapshots-cleaning"
*******************************************
+ Concat_fragment[profile::cron::etcd-snapshots-cleaning] =>
   parameters =>
     "content": "# Cron snippet etcd-snapshots-cleaning\n0 1,6,11,16,21 * * * roo...
     "order": "10",
     "tag": "profile::cron::etcd-snapshots-cleaning",
     "target": "profile::cron::etcd-snapshots-cleaning"
*******************************************
+ File[/etc/cron.d/etcd-snapshots-cleaning] =>
   parameters =>
     "ensure": "absent"
*******************************************
+ File[/etc/cron.d/puppet-etcd-snapshots-cleaning] =>
   parameters =>
     "ensure": "link",
     "target": "/etc/puppet-cron.d/etcd-snapshots-cleaning"
*******************************************
+ File[/usr/local/sbin/etcd-snapshots-cleaning.sh] =>
   parameters =>
     "content": "#!/usr/bin/env bash\n# vim: ai ts=4 sts=4 sw=4\n# This file is m...
     "ensure": "file",
     "group": "root",
     "mode": "0754",
     "owner": "root"
*******************************************
+ Profile::Cron::D[etcd-snapshots-cleaning] =>
   parameters =>
     "command": "chronic /usr/local/sbin/etcd-snapshots-cleaning.sh",
     "hour": "1,6,11,16,21",
     "minute": 0,
     "target": "etcd-snapshots-cleaning",
     "unique_tag": "etcd-snapshots-cleaning",
     "user": "root"
*******************************************
+ Profile::Cron::File[etcd-snapshots-cleaning] =>
   parameters =>
     "target": "etcd-snapshots-cleaning"
*******************************************
*** End octocatalog-diff on rancher-node-production-rke2-mgmt1.internal.softwareheritage.org
ᐅ bin/octocatalog-diff -f production -t rancher_retention_cleaning rancher-node-production-rke2-mgmt2
Found host rancher-node-production-rke2-mgmt2.internal.softwareheritage.org
Cloning into '/tmp/swh-ocd.5EZZzFHr/swh-site'...
done.
branch 'rancher_retention_cleaning' set up to track 'origin/rancher_retention_cleaning'.
Switched to a new branch 'rancher_retention_cleaning'
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 40b02924] 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 'rancher_retention_cleaning'
Your branch is up to date with 'origin/rancher_retention_cleaning'.
Auto-merging Puppetfile
[rancher_retention_cleaning 2fefc3fa] 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.5EZZzFHr/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.5EZZzFHr/environments/rancher_retention_cleaning/data/private'...
done.
*** Running octocatalog-diff on host rancher-node-production-rke2-mgmt2.internal.softwareheritage.org
I, [2024-07-25T17:37:41.203883 #725032]  INFO -- : Catalogs compiled for rancher-node-production-rke2-mgmt2.internal.softwareheritage.org
I, [2024-07-25T17:37:41.393218 #725032]  INFO -- : Diffs computed for rancher-node-production-rke2-mgmt2.internal.softwareheritage.org
I, [2024-07-25T17:37:41.393265 #725032]  INFO -- : No differences
*** End octocatalog-diff on rancher-node-production-rke2-mgmt2.internal.softwareheritage.org

Merge request reports

Loading