homeserver/roles/mgrote_pbs_datastores/tasks/main.yml

43 lines
1.1 KiB
YAML
Raw Normal View History

---
- 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