Use more reliable option to get cluster ready state and remove ansible_python_interpreter
This is a merge of two previous patches [1,2] which require each other in order to merge in particular due to unpredictable behaviour of MariaDB 10.4 during cluster status reporting which is addressed through [2]. [1] https://review.opendev.org/735204 [2] https://review.opendev.org/735079 Co-Authored-By: Dmitriy Rabotyagov <drabotyagov@vexxhost.com> Co-Authored-By: Marc Gariepy <gariepy.marc@gmail.com> Change-Id: Id04fa994f527e2a15a87ba91d56d10eaadf8f58f
This commit is contained in:
parent
91ce47d1fc
commit
36f35bee26
@ -15,5 +15,3 @@
|
|||||||
|
|
||||||
bridges:
|
bridges:
|
||||||
- "br-mgmt"
|
- "br-mgmt"
|
||||||
|
|
||||||
ansible_python_interpreter: "/usr/bin/python2"
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
user: root
|
user: root
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Wait for cluster to be ready
|
||||||
|
block:
|
||||||
- name: Wait for cluster ready state
|
- name: Wait for cluster ready state
|
||||||
command: |
|
command: |
|
||||||
mysql -h {{ ansible_host }} \
|
mysql -h {{ ansible_host }} \
|
||||||
@ -29,7 +31,24 @@
|
|||||||
retries: 20
|
retries: 20
|
||||||
delay: 5
|
delay: 5
|
||||||
changed_when: false
|
changed_when: false
|
||||||
until: mysql_instance_ready is success
|
until: mysql_instance_ready is success and mysql_instance_ready.stdout.split()[-1].split(',') | length == groups['galera_all'] | length
|
||||||
|
rescue:
|
||||||
|
- name: Restarting weird maria instance
|
||||||
|
service:
|
||||||
|
name: mariadb
|
||||||
|
state: restarted
|
||||||
|
- name: Wait for cluster ready state
|
||||||
|
command: |
|
||||||
|
mysql -h {{ ansible_host }} \
|
||||||
|
-p"{{ galera_root_password }}" \
|
||||||
|
-e "show status like 'wsrep_incoming_addresses';" \
|
||||||
|
--silent \
|
||||||
|
--skip-column-names
|
||||||
|
register: mysql_instance_ready
|
||||||
|
retries: 20
|
||||||
|
delay: 5
|
||||||
|
changed_when: false
|
||||||
|
until: mysql_instance_ready is success and mysql_instance_ready.stdout.split()[-1].split(',') | length == groups['galera_all'] | length
|
||||||
- name: Check cluster incoming addresses
|
- name: Check cluster incoming addresses
|
||||||
command: |
|
command: |
|
||||||
mysql -h {{ ansible_host }} \
|
mysql -h {{ ansible_host }} \
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
- openstack-ansible-functional-opensuse-15-ssl:
|
- openstack-ansible-functional-opensuse-15-ssl:
|
||||||
voting: false
|
voting: false
|
||||||
- openstack-ansible-functional-ubuntu-bionic-ssl
|
- openstack-ansible-functional-ubuntu-bionic-ssl
|
||||||
|
- openstack-ansible-upgrade-aio_metal-ubuntu-bionic:
|
||||||
|
voting: false
|
||||||
experimental:
|
experimental:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-ansible-integrated-deploy-aio
|
- openstack-ansible-integrated-deploy-aio
|
||||||
@ -34,3 +36,5 @@
|
|||||||
jobs:
|
jobs:
|
||||||
- openstack-ansible-functional-centos-7-ssl
|
- openstack-ansible-functional-centos-7-ssl
|
||||||
- openstack-ansible-functional-ubuntu-bionic-ssl
|
- openstack-ansible-functional-ubuntu-bionic-ssl
|
||||||
|
- openstack-ansible-upgrade-aio_metal-ubuntu-bionic:
|
||||||
|
voting: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user