Ensure management_address is used instead of ansible_host
ansible_host in deployments is designed to represent SSH address. In cases, when address that used for SSH is different from management network, this might lead to undpredictable results on bare metal hosts. Thus we're ensuring that management (container) address is used for services to listen on and to interact through. Related-Bug: #2002645 Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/870113 Change-Id: I8a5e817d024eef5453fa072d8fee5aeca9bed67b
This commit is contained in:
parent
83979e7575
commit
6a0646470a
@ -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(',')
|
||||
}}
|
||||
|
@ -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'
|
||||
}}
|
||||
|
@ -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 }}"
|
||||
|
@ -28,7 +28,7 @@
|
||||
{% set _prio = 50 %}
|
||||
{% endif %}
|
||||
{% set _ = _var.append({
|
||||
'host': hostvars[host]['ansible_host'],
|
||||
'host': hostvars[host]['management_address'],
|
||||
'priority': _prio
|
||||
})
|
||||
%}
|
||||
|
@ -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')] }}"
|
||||
|
||||
|
@ -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] }}"
|
||||
|
Loading…
Reference in New Issue
Block a user