homeserver/roles/mgrote.pbs_datastores/tasks/main.yml
mg 154fc0ef58 neuer Backup-Server (pbs) (#538)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #538
2023-06-23 16:04:19 +02:00

42 lines
1.1 KiB
YAML

---
- name: check if datastores exist
become: yes
ansible.builtin.command: "proxmox-backup-manager datastore list --output-format json"
register: datastores
changed_when: false
- name: ensure datastores exist
become: yes
ansible.builtin.command: "proxmox-backup-manager datastore create {{ item.name }} {{ item.path }}"
loop: "{{ pbs_datastores }}"
when: "item.name not in datastores.stdout"
- name: ensure datastores are configured
become: yes
ansible.builtin.template:
src: datastores.j2
dest: /etc/proxmox-backup/datastore.cfg
owner: root
group: backup
mode: "640"
backup: yes
- name: ensure prune-jobs are configured
become: yes
ansible.builtin.template:
src: prune-jobs.j2
dest: /etc/proxmox-backup/prune.cfg
owner: root
group: backup
mode: "640"
backup: yes
- name: ensure permissions are configured
become: yes
ansible.builtin.template:
src: permissions.j2
dest: /etc/proxmox-backup/acl.cfg
owner: root
group: backup
mode: "640"
backup: yes