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:
Marc Gariepy 2020-06-11 13:37:36 -04:00 committed by Dmitriy Rabotyagov
parent 7c165c40cb
commit 32192de0ce
3 changed files with 35 additions and 2 deletions

View File

@ -15,5 +15,3 @@
bridges:
- "br-mgmt"
ansible_python_interpreter: "/usr/bin/python2"

View File

@ -18,6 +18,37 @@
user: root
gather_facts: true
tasks:
- name: Wait for cluster to be ready
block:
- 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
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
command: |
mysql -h {{ ansible_host }} \

View File

@ -27,6 +27,8 @@
- openstack-ansible-functional-opensuse-15-ssl:
voting: false
- openstack-ansible-functional-ubuntu-bionic-ssl
- openstack-ansible-upgrade-aio_metal-ubuntu-bionic:
voting: false
experimental:
jobs:
- openstack-ansible-integrated-deploy-aio
@ -34,3 +36,5 @@
jobs:
- openstack-ansible-functional-centos-7-ssl
- openstack-ansible-functional-ubuntu-bionic-ssl
- openstack-ansible-upgrade-aio_metal-ubuntu-bionic:
voting: false