diff --git a/inventory/group_vars/all/infra.yml b/inventory/group_vars/all/infra.yml index 61d2422476..df2b5eb004 100644 --- a/inventory/group_vars/all/infra.yml +++ b/inventory/group_vars/all/infra.yml @@ -21,7 +21,7 @@ rabbitmq_use_ssl: True rabbitmq_servers: >- {{ groups[rabbitmq_host_group] - | map('extract', hostvars, 'ansible_host') + | map('extract', hostvars, 'management_address') | list | join(',') }} rabbitmq_policies: @@ -42,7 +42,7 @@ galera_use_ssl: "{{ not (ansible_facts['os_family'] | lower == 'redhat' and ins memcached_port: 11211 memcached_servers: >- {{ - (groups['memcached'] | map('extract', hostvars, 'ansible_host') | list) + (groups['memcached'] | map('extract', hostvars, 'management_address') | list) | map('regex_replace', '(.+)' ,'\1:' ~ memcached_port) | list | join(',') @@ -56,6 +56,6 @@ qdrouterd_use_ssl: False qdrouterd_servers: >- {{ groups[qdrouterd_host_group] - | map('extract', hostvars, 'ansible_host') + | map('extract', hostvars, 'management_address') | list | join(',') }} diff --git a/inventory/group_vars/galera_all.yml b/inventory/group_vars/galera_all.yml index 394bb9f730..4639507ea6 100644 --- a/inventory/group_vars/galera_all.yml +++ b/inventory/group_vars/galera_all.yml @@ -33,7 +33,7 @@ galera_disable_privatedevices: "{{ not is_metal }}" galera_monitoring_allowed_source: >- {{ groups['galera_all'] | union(groups['haproxy']) - | map('extract', hostvars, 'ansible_host') + | map('extract', hostvars, 'management_address') | list | join(' ') ~ ' 127.0.0.1' }} @@ -43,7 +43,7 @@ galera_monitoring_allowed_source: >- galera_server_proxy_protocol_networks: >- {{ groups['haproxy'] - | map('extract', hostvars, 'ansible_host') + | map('extract', hostvars, 'management_address') | list | join(',') ~ ', localhost, ::1' }} diff --git a/inventory/group_vars/memcached.yml b/inventory/group_vars/memcached.yml index be8fdb620a..2ad5258e6d 100644 --- a/inventory/group_vars/memcached.yml +++ b/inventory/group_vars/memcached.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -memcached_listen: "{{ ansible_host }}" +memcached_listen: "{{ management_address }}" # Ensure that the package state matches the global setting memcached_package_state: "{{ package_state }}" diff --git a/playbooks/common-tasks/unbound-clients.yml b/playbooks/common-tasks/unbound-clients.yml index c99885f453..dd2d77c2b9 100644 --- a/playbooks/common-tasks/unbound-clients.yml +++ b/playbooks/common-tasks/unbound-clients.yml @@ -28,7 +28,7 @@ {% set _prio = 50 %} {% endif %} {% set _ = _var.append({ - 'host': hostvars[host]['ansible_host'], + 'host': hostvars[host]['management_address'], 'priority': _prio }) %} diff --git a/playbooks/healthcheck-infrastructure.yml b/playbooks/healthcheck-infrastructure.yml index 61098b63ee..a1feca49e0 100644 --- a/playbooks/healthcheck-infrastructure.yml +++ b/playbooks/healthcheck-infrastructure.yml @@ -167,7 +167,7 @@ block: - name: Wait for cluster ready state command: | - mysql -h {{ ansible_host }} \ + mysql -h {{ management_address }} \ -u "{{ galera_root_user | default('root') }}" \ -p"{{ galera_root_password }}" \ -e "show status like 'wsrep_incoming_addresses';" \ @@ -185,7 +185,7 @@ state: restarted - name: Wait for cluster ready state command: | - mysql -h {{ ansible_host }} \ + mysql -h {{ management_address }} \ -u "{{ galera_root_user | default('root') }}" \ -p"{{ galera_root_password }}" \ -e "show status like 'wsrep_incoming_addresses';" \ @@ -199,7 +199,7 @@ - name: Check cluster local state command: | - mysql -h {{ ansible_host }} \ + mysql -h {{ management_address }} \ -u "{{ galera_root_user | default('root') }}" \ -p"{{ galera_root_password }}" \ -e "show status like 'wsrep_local_state_comment';" \ @@ -212,7 +212,7 @@ - name: Check cluster evs state command: | - mysql -h {{ ansible_host }} \ + mysql -h {{ management_address }} \ -u "{{ galera_root_user | default('root') }}" \ -p"{{ galera_root_password }}" \ -e "show status like 'wsrep_evs_state';" \ @@ -233,7 +233,7 @@ community.mysql.mysql_db: login_user: "{{ galera_root_user | default('root') }}" login_password: "{{ galera_root_password }}" - login_host: "{{ ansible_host }}" + login_host: "{{ management_address }}" name: "OSA-test" state: "present" when: inventory_hostname == groups['galera_all'][0] @@ -244,7 +244,7 @@ community.mysql.mysql_user: login_user: "{{ galera_root_user | default('root') }}" login_password: "{{ galera_root_password }}" # noqa no-log-password - login_host: "{{ ansible_host }}" + login_host: "{{ management_address }}" name: "osa-tester" password: "tester-secrete" # noqa no-log-password host: "{{ item }}" @@ -269,7 +269,7 @@ community.mysql.mysql_user: login_user: "{{ galera_root_user | default('root') }}" login_password: "{{ galera_root_password }}" # noqa no-log-password - login_host: "{{ ansible_host }}" + login_host: "{{ management_address }}" name: "osa-tester" state: "absent" host: "{{ item }}" @@ -282,7 +282,7 @@ community.mysql.mysql_db: login_user: "{{ galera_root_user | default('root') }}" login_password: "{{ galera_root_password }}" # noqa no-log-password - login_host: "{{ ansible_host }}" + login_host: "{{ management_address }}" name: "OSA-test" state: "absent" when: inventory_hostname == groups['galera_all'][0] @@ -368,7 +368,7 @@ tasks: - name: Probing TCP connection to zookeeper wait_for: - host: "{{ hostvars[item]['ansible_host'] }}" + host: "{{ hostvars[item]['management_address'] }}" port: "{{ coordination_port | default(2181) }}" with_items: "{{ groups[coordination_host_group | default('zookeeper_all')] }}" diff --git a/scripts/upgrade-utilities/galera-cluster-rolling-restart.yml b/scripts/upgrade-utilities/galera-cluster-rolling-restart.yml index d99d46db1e..d98f6bd2ce 100644 --- a/scripts/upgrade-utilities/galera-cluster-rolling-restart.yml +++ b/scripts/upgrade-utilities/galera-cluster-rolling-restart.yml @@ -53,7 +53,7 @@ - name: Wait for mariadb port 3306 to be available wait_for: port: "3306" - host: "{{ ansible_host | default(ansible_ssh_host | default(inventory_hostname)) }}" + host: "{{ management_address | default(ansible_ssh_host | default(inventory_hostname)) }}" retries: 10 delay: 10 delegate_to: "{{ groups['utility_all'][0] }}"