Improve compatibility with connection delegation
In some cases when delegated hosts are used with connection plugins and variables are used in the ansible_host var, they can be resolved using the wrong node (the source of the delegated task, rather than the target of the delegated task), causing the connection plugin to run all of the mysql restarts on the same host, rather than delegating to the correct ansible_host. This minor fix improves compatibility in these situations so that ansible_host is set to the correct host, causing the task to run against the correct node. Depends-On: https://review.opendev.org/687142 Change-Id: I082f4920cc8366e3b1309c952a5104d3d63215e5
This commit is contained in:
parent
edd360694e
commit
3d405dfd52
@ -63,6 +63,8 @@
|
||||
changed_when: start_new_cluster.rc == 3
|
||||
register: start_new_cluster
|
||||
delegate_to: "{{ galera_server_bootstrap_node }}"
|
||||
vars:
|
||||
ansible_host: "{{ hostvars[galera_server_bootstrap_node]['ansible_host'] }}"
|
||||
run_once: true
|
||||
when:
|
||||
- not galera_cluster_ready | bool
|
||||
@ -79,6 +81,8 @@
|
||||
retries: 6
|
||||
delay: 5
|
||||
delegate_to: "{{ item }}"
|
||||
vars:
|
||||
ansible_host: "{{ hostvars[item]['ansible_host'] }}"
|
||||
when:
|
||||
- hostvars[item]['galera_cluster_ready'] is defined
|
||||
- hostvars[item]['galera_deployed'] | default(false) | bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user