Skip to content

Commit e7410bd

Browse files
committed
Fix host used to configure HA groups
When the role is run with `--limit nodes_without_first_node`, the HA groups are not configured (tasks are skipped). Use `_init_node` instead of `groups[pve_group][0]` to run the tasks. `_init_node` is any active node in an already initialized Proxmox cluster which is part of the run.
1 parent 569a203 commit e7410bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tasks/pve_cluster_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
proxmox_query:
8181
query: "/cluster/ha/groups"
8282
register: _ha_group_list
83-
when: "inventory_hostname == groups[pve_group][0]"
83+
when: "inventory_hostname == _init_node"
8484

8585
- name: Create PVE cluster HA groups
8686
command: >-
@@ -94,15 +94,15 @@
9494
-restricted {{ item.restricted }}
9595
{% endif %}
9696
when:
97-
- "inventory_hostname == groups[pve_group][0]"
97+
- "inventory_hostname == _init_node"
9898
- item.name not in _ha_group_list.response | json_query("[*].group")
9999
with_items: "{{ pve_cluster_ha_groups }}"
100100

101101
- name: Update PVE cluster HA groups
102102
command: >-
103103
ha-manager groupset {{ item.0.name }} -{{ item.1 }} "{{ item.0[item.1] }}"
104104
when:
105-
- "inventory_hostname == groups[pve_group][0]"
105+
- "inventory_hostname == _init_node"
106106
- item.0.name in _ha_group_list.response | json_query("[*].group")
107107
- item.1 in item.0
108108
- item.0[item.1] != _ha_group_list.response

0 commit comments

Comments
 (0)