From 95b73daa36b23565a8566f71f9b202d3459b685f Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 25 Jun 2023 09:52:36 -0400 Subject: Initial Commit --- roles/proxmox/proxmox_backup_server/tasks/main.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 roles/proxmox/proxmox_backup_server/tasks/main.yml (limited to 'roles/proxmox/proxmox_backup_server') diff --git a/roles/proxmox/proxmox_backup_server/tasks/main.yml b/roles/proxmox/proxmox_backup_server/tasks/main.yml new file mode 100644 index 0000000..3e91a19 --- /dev/null +++ b/roles/proxmox/proxmox_backup_server/tasks/main.yml @@ -0,0 +1,42 @@ +- name: add proxmox backup repo + apt_repository: + repo: deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription + state: present + update_cache: yes + +- name: install proxmox backup server and client + package: + name: + - proxmox-backup-server + - proxmox-backup-client + +- name: create datastore + command: + cmd: "proxmox-backup-manager datastore create {{ pbs_datastore }} {{ pbs_datastore_path }} --keep-last {{ pbs_keep_last }} --keep-daily {{ pbs_keep_daily }} --keep-weekly {{ pbs_keep_weekly }} --keep-monthly {{ pbs_keep_monthly }} --keep-yearly {{ pbs_keep_yearly }}" + register: result + changed_when: false + failed_when: result.rc not in [255] + +- name: create backup admin + command: + cmd: "proxmox-backup-manager user create {{ pbs_admin }} --password {{ pbs_admin_password }}" + register: result + changed_when: false + failed_when: result.rc not in [255] + +- name: assign permissions for backup admin + changed_when: false + command: + cmd: "proxmox-backup-manager acl update / Admin --auth-id {{ pbs_admin }}" + +- name: create backup user + command: + cmd: "proxmox-backup-manager user create {{ pbs_user }} --password {{ pbs_password }}" + register: result + failed_when: result.rc not in [255] + changed_when: false + +- name: assign permissions for backup user + changed_when: false + command: + cmd: "proxmox-backup-manager acl update / DatastoreBackup --auth-id {{ pbs_user }}" -- cgit v1.2.3