diff --git a/tasks/check-and-prepare-role-variables.yml b/tasks/check-and-prepare-role-variables.yml index aab692e6..90fa6a24 100644 --- a/tasks/check-and-prepare-role-variables.yml +++ b/tasks/check-and-prepare-role-variables.yml @@ -16,7 +16,7 @@ when: - ha_cluster_sbd_enabled - > - ansible_play_hosts_all + ansible_play_hosts | map('extract', hostvars, ['ha_cluster', 'sbd_devices']) | map('default', [], true) | map('length') | unique | length > 1 @@ -32,7 +32,7 @@ - name: Collect cluster node names set_fact: __ha_cluster_all_node_names: "{{ - ansible_play_hosts_all + ansible_play_hosts | map('extract', hostvars, '__ha_cluster_node_name') | list }}" diff --git a/tasks/cluster-setup-pcs-0.10.yml b/tasks/cluster-setup-pcs-0.10.yml index b023fa9c..078bf7b2 100644 --- a/tasks/cluster-setup-pcs-0.10.yml +++ b/tasks/cluster-setup-pcs-0.10.yml @@ -11,7 +11,7 @@ {% endif %} -- {{ ha_cluster_cluster_name | quote }} - {% for node in ansible_play_hosts_all %} + {% for node in ansible_play_hosts %} {{ hostvars[node].__ha_cluster_node_name | quote }} {% for addr in hostvars[node].ha_cluster.corosync_addresses | default([]) diff --git a/tasks/pcs-auth-pcs-0.10.yml b/tasks/pcs-auth-pcs-0.10.yml index 169159f5..06bd6eac 100644 --- a/tasks/pcs-auth-pcs-0.10.yml +++ b/tasks/pcs-auth-pcs-0.10.yml @@ -6,7 +6,7 @@ # pcs auth tokens in the cluster when not all nodes are auth-ed. cmd: > pcs host auth -u hacluster -- - {% for node in ansible_play_hosts_all %} + {% for node in ansible_play_hosts %} {{ hostvars[node].__ha_cluster_node_name | quote }} {% if hostvars[node].ha_cluster.pcs_address | default("") %} addr={{ hostvars[node].ha_cluster.pcs_address | quote }} diff --git a/tasks/pcs-auth.yml b/tasks/pcs-auth.yml index 81671781..b7c1bd62 100644 --- a/tasks/pcs-auth.yml +++ b/tasks/pcs-auth.yml @@ -4,7 +4,7 @@ command: cmd: > pcs status pcsd -- - {% for node in ansible_play_hosts_all %} + {% for node in ansible_play_hosts %} {{ hostvars[node].__ha_cluster_node_name | quote }} {% endfor %} register: __ha_cluster_pcs_auth_status diff --git a/tasks/presharedkey.yml b/tasks/presharedkey.yml index b3d8dcd5..75ebe352 100644 --- a/tasks/presharedkey.yml +++ b/tasks/presharedkey.yml @@ -77,7 +77,7 @@ # Following variables set the fact for all nodes delegate_facts: yes delegate_to: "{{ item }}" - with_items: "{{ ansible_play_hosts_all }}" + with_items: "{{ ansible_play_hosts }}" when: - not (preshared_key_src is string and preshared_key_src | length > 1) - not ha_cluster_regenerate_keys