Merge "Ensure management_address is used instead of ansible_host"

This commit is contained in:
Zuul 2023-06-19 16:16:25 +00:00 committed by Gerrit Code Review
commit 42b7c85528
6 changed files with 17 additions and 17 deletions

View File

@ -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(',')
}}

View File

@ -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'
}}

View File

@ -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 }}"

View File

@ -28,7 +28,7 @@
{% set _prio = 50 %}
{% endif %}
{% set _ = _var.append({
'host': hostvars[host]['ansible_host'],
'host': hostvars[host]['management_address'],
'priority': _prio
})
%}

View File

@ -169,7 +169,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';" \
@ -187,7 +187,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';" \
@ -201,7 +201,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';" \
@ -214,7 +214,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';" \
@ -235,7 +235,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]
@ -246,7 +246,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 }}"
@ -271,7 +271,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 }}"
@ -284,7 +284,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]
@ -370,7 +370,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')] }}"

View File

@ -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] }}"