Michael Grote
7a24089031
Reviewed-on: #584 Co-authored-by: Michael Grote <michael.grote@posteo.de> Co-committed-by: Michael Grote <michael.grote@posteo.de>
42 lines
1.1 KiB
YAML
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
|