homeserver/roles/mgrote_pbs_datastores/tasks/main.yml
Michael Grote 7a24089031 fix linter errors (#584)
Reviewed-on: #584
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
2023-10-25 22:26:17 +02:00

42 lines
1.1 KiB
YAML

---
- name: check if datastores exist # noqa no-changed-when
become: true
ansible.builtin.command: "proxmox-backup-manager datastore list --output-format json"
register: datastores
changed_when: false
- name: ensure datastores exist # noqa no-changed-when
become: true
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: true
ansible.builtin.template:
src: datastores.j2
dest: /etc/proxmox-backup/datastore.cfg
owner: root
group: backup
mode: "0640"
backup: true
- name: ensure prune-jobs are configured
become: true
ansible.builtin.template:
src: prune-jobs.j2
dest: /etc/proxmox-backup/prune.cfg
owner: root
group: backup
mode: "0640"
backup: true
- name: ensure permissions are configured
become: true
ansible.builtin.template:
src: permissions.j2
dest: /etc/proxmox-backup/acl.cfg
owner: root
group: backup
mode: "0640"
backup: true