sanoid: configure the db1 -> storage1 zfs replication
2 commits:
- first one:
sanoid: prepare the server to server zfs replication
- Rename the profile::sanoid::backup to snapshot to match the replication
action
- Create an install class adapting the installation regarding the debian
version
- Configure the systemd timer and service to regularly pull a dataset
storage from a source server. The job will be initiated by the
target
- Configure the ssh environment to automatically install the ssh keys
Related to [T3911](https://forge.softwareheritage.org/T3911 'view original for T3911 on Phabricator')
- second one:
sanoid: configure the db1 -> storage1 zfs replication
- declare a public key for storage1 (private part in private_data)
- configure syncoid to replicate the postgresql dataset
Related to [T3911](https://forge.softwareheritage.org/T3911 'view original for T3911 on Phabricator')
Test Plan
- storage1
diff origin/production/storage1.internal.staging.swh.network current/storage1.internal.staging.swh.network
*******************************************
+ Archive[sanoid] =>
parameters =>
"checksum": "63115326695a00dc925d3ec8c307ed2543bb0a2479f2b15be3192bf2c7d5003...
"checksum_type": "sha256",
"cleanup": true,
"creates": "/opt/sanoid-2.0.3/sanoid",
"extract": true,
"extract_command": "tar xzf %s --strip-components=1 --no-same-owner --no-sam...
"extract_path": "/opt/sanoid-2.0.3",
"group": "root",
"path": "/opt/sanoid-v2.0.3.tar.gz",
"source": "https://github.com/jimsalterjrs/sanoid/archive/refs/tags/v2.0.3.t...
"user": "root"
*******************************************
+ File[/etc/systemd/system/syncoid-db1-postgresql-main-12.service] =>
parameters =>
"content": "# Managed by puppet class profile::sanoid::syncoid_destination\n...
"ensure": "file",
"group": "root",
"mode": "0444",
"notify": "Class[Systemd::Systemctl::Daemon_reload]",
"owner": "root",
"show_diff": true
*******************************************
+ File[/etc/systemd/system/syncoid-db1-postgresql-main-12.timer] =>
parameters =>
"content": "# Managed by puppet class profile::sanoid::syncoid_destination\n...
"ensure": "file",
"group": "root",
"mode": "0444",
"notify": [
"Class[Systemd::Systemctl::Daemon_reload]",
"Service[syncoid-db1-postgresql-main-12.timer]"
],
"owner": "root",
"show_diff": true
*******************************************
+ File[/opt/sanoid-2.0.3] =>
parameters =>
"ensure": "directory",
"group": "root",
"owner": "root"
*******************************************
+ File[/opt/sanoid] =>
parameters =>
"ensure": "link",
"group": "root",
"owner": "root",
"target": "/opt/sanoid-2.0.3"
*******************************************
+ File[/root/.ssh/id_ed25519.syncoid_storage1] =>
parameters =>
"content": "syncoid::ssh_key::storage1",
"ensure": "present",
"group": "root",
"mode": "0600",
"owner": "root"
*******************************************
+ File[/usr/sbin/findoid] =>
parameters =>
"ensure": "link",
"group": "root",
"owner": "root",
"target": "/opt/sanoid/findoid"
*******************************************
+ File[/usr/sbin/sanoid] =>
parameters =>
"ensure": "link",
"group": "root",
"owner": "root",
"target": "/opt/sanoid/sanoid"
*******************************************
+ File[/usr/sbin/syncoid] =>
parameters =>
"ensure": "link",
"group": "root",
"owner": "root",
"target": "/opt/sanoid/syncoid"
*******************************************
+ Package[libcapture-tiny-perl] =>
parameters =>
"ensure": "installed"
*******************************************
+ Package[libconfig-inifiles-perl] =>
parameters =>
"ensure": "installed"
*******************************************
+ Package[lzop] =>
parameters =>
"ensure": "installed"
*******************************************
+ Package[mbuffer] =>
parameters =>
"ensure": "installed"
*******************************************
+ Package[pv] =>
parameters =>
"ensure": "installed"
*******************************************
+ Package[zfsutils-linux] =>
parameters =>
"ensure": "installed"
*******************************************
+ Service[syncoid-db1-postgresql-main-12.timer] =>
parameters =>
"enable": true,
"ensure": true,
"provider": "systemd"
*******************************************
+ Systemd::Timer[syncoid-db1-postgresql-main-12.timer] =>
parameters =>
"active": true,
"enable": true,
"ensure": "present",
"group": "root",
"mode": "0444",
"owner": "root",
"path": "/etc/systemd/system",
"service_content": "# Managed by puppet class profile::sanoid::syncoid_desti...
"service_unit": "syncoid-db1-postgresql-main-12.service",
"show_diff": true,
"timer_content": "# Managed by puppet class profile::sanoid::syncoid_destina...
*******************************************
+ Systemd::Unit_file[syncoid-db1-postgresql-main-12.service] =>
parameters =>
"content": "# Managed by puppet class profile::sanoid::syncoid_destination\n...
"ensure": "present",
"group": "root",
"mode": "0444",
"owner": "root",
"path": "/etc/systemd/system",
"show_diff": true
*******************************************
+ Systemd::Unit_file[syncoid-db1-postgresql-main-12.timer] =>
parameters =>
"active": true,
"content": "# Managed by puppet class profile::sanoid::syncoid_destination\n...
"enable": true,
"ensure": "present",
"group": "root",
"mode": "0444",
"owner": "root",
"path": "/etc/systemd/system",
"show_diff": true
*******************************************
*** End octocatalog-diff on storage1.internal.staging.swh.network
- db1 Only collected ressources
Migrated from D7173 (view on Phabricator)