veza/ansible/roles/incus/tasks/get_and_set_cluster.yml
2025-12-03 22:56:50 +01:00

13 lines
592 B
YAML

---
# file: roles/incus/tasks/get_and_set_cluster.yml
- name: "incus cluster get {{ ansible_hostname }} {{ item.key }}"
shell: "/usr/bin/incus cluster get {{ ansible_hostname }} {{ item.key }}"
register: get_configuration
changed_when: false
check_mode: false
failed_when: get_configuration.rc != 0 and "does not exist on cluster member" not in get_configuration.stderr
- name: "incus cluster set {{ ansible_hostname }} set {{ item.key }}"
shell: "/usr/bin/incus cluster set {{ ansible_hostname }} {{ item.key }}={{ item.value }}"
when: get_configuration.stdout != item.value