24 lines
859 B
YAML
24 lines
859 B
YAML
|
---
|
||
|
- name: check which storages exist
|
||
|
become: yes
|
||
|
ansible.builtin.shell: "pvesm status | awk '{ print $1}'"
|
||
|
register: storages
|
||
|
changed_when: false
|
||
|
|
||
|
- name: ensure datastore exist
|
||
|
become: yes
|
||
|
ansible.builtin.command: "pvesm add pbs {{ item.name }} --server {{ item.server }} --datastore {{ item.datastore }} --username {{ item.username }} --password {{ item.password }} --fingerprint {{ item.fingerprint }}"
|
||
|
loop: "{{ pve_pbs_datastore }}"
|
||
|
when: "item.name not in storages.stdout"
|
||
|
|
||
|
- name: ensure datastore is configured
|
||
|
become: yes
|
||
|
ansible.builtin.command: "pvesm set {{ item.name }} --username {{ item.username }} --password {{ item.password }}"
|
||
|
loop: "{{ pve_pbs_datastore }}"
|
||
|
when: "item.name in storages.stdout"
|
||
|
changed_when: false
|
||
|
|
||
|
|
||
|
|
||
|
# alle pbs variablen beschscireben und kennworter in keeprss
|