Skip to content

Commit cfab676

Browse files
committed
fix minimum host count in current inventory group before enabling pve-cluster
1 parent 569a203 commit cfab676

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
with_items: "{{ groups[pve_group] }}"
1515
when: "pve_cluster_enabled | bool"
1616

17+
- name: Count host in {{ pve_group }}
18+
set_fact:
19+
pve_cluster_host_count: "{{ groups[pve_group] | length }}"
20+
21+
- name: Ensure that group has more than one host to enable pve_cluster
22+
set_fact:
23+
pve_cluster_enabled: false
24+
when: "pve_cluster_host_count | int <= 1"
25+
1726
- name: Ensure this host is in the group specified
1827
assert:
1928
that:

0 commit comments

Comments
 (0)