From 613baaa1fcc3b16856f0da34002201646515955b Mon Sep 17 00:00:00 2001 From: Jocelyn Jaubert Date: Thu, 25 Jul 2024 20:05:13 +0200 Subject: [PATCH] =?UTF-8?q?proxmox-backup:=20Passage=20=C3=A0=20syncoid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts | 3 +++ roles/proxmox-backup/tasks/main.yml | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hosts b/hosts index 235ed15c..e076ea61 100644 --- a/hosts +++ b/hosts @@ -294,6 +294,9 @@ osm26.openstreetmap.fr proxmox_backup_exclude="118 144 186 999" proxmox_backup_t osm27.openstreetmap.fr proxmox_backup_exclude="118 144 186 999" proxmox_backup_target="osm32.openstreetmap.fr:rpool/backups" osm28.openstreetmap.fr proxmox_backup_exclude="118 144 186 999" proxmox_backup_target="osm32.openstreetmap.fr:rpool/backups" osm32.openstreetmap.fr proxmox_backup_host=true +osm43.openstreetmap.fr proxmox_backup_exclude="101 118 144 186 209 400 999 9000" proxmox_backup_target="osm32.openstreetmap.fr:backups/cluster-moji" +osm40.openstreetmap.fr proxmox_backup_exclude="101 118 144 186 209 400 999 9000" proxmox_backup_target="osm32.openstreetmap.fr:backups/cluster-moji" +osm43.openstreetmap.fr proxmox_backup_exclude="101 118 144 186 209 400 999 9000" proxmox_backup_target="osm32.openstreetmap.fr:backups/cluster-moji" [renderd] osm13.openstreetmap.fr renderd_layers=true diff --git a/roles/proxmox-backup/tasks/main.yml b/roles/proxmox-backup/tasks/main.yml index 525e2799..4746bbff 100644 --- a/roles/proxmox-backup/tasks/main.yml +++ b/roles/proxmox-backup/tasks/main.yml @@ -2,6 +2,7 @@ apt: pkg: - python3 + - sanoid - name: add user proxmox-backup user: @@ -32,6 +33,8 @@ key_options: "no-port-forwarding" with_items: "{{ groups['proxmox-backup'] }}" + when: + proxmox_backup_host is defined - name: configure sudoers to launch pct commands community.general.sudoers: @@ -39,20 +42,27 @@ user: proxmox-backup commands: - /usr/bin/cat /etc/pve/.vmlist - - /usr/bin/cat /etc/pve/lxc/*.conf - /usr/sbin/pct snapshot * - /usr/sbin/pct listsnapshot * - /usr/sbin/pct delsnapshot * - - /usr/sbin/zfs send * + - /usr/sbin/pct config * + - /usr/sbin/pvesm path * when: proxmox_backup_host is not defined -- name: configure sudoers to launch zfs commands - community.general.sudoers: - name: proxmox-backup-host - user: proxmox-backup - commands: - - /usr/sbin/zfs recv * +- name: Allow zfs commands to send + community.general.zfs_delegate_admin: + name: local-zfs + users: proxmox-backup + permissions: send,hold,mount,snapshot,destroy + when: + proxmox_backup_host is not defined + +- name: Allow zfs commands to receive + community.general.zfs_delegate_admin: + name: backups + users: proxmox-backup + permissions: compression,mountpoint,create,mount,receive,rollback,destroy when: proxmox_backup_host is defined