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 Jonathan Rosser
parent 91ce47d1fc
commit 36f35bee26
3 changed files with 35 additions and 14 deletions

View File

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

View File

@ -18,18 +18,37 @@
user: root user: root
gather_facts: true gather_facts: true
tasks: tasks:
- name: Wait for cluster ready state - name: Wait for cluster to be ready
command: | block:
mysql -h {{ ansible_host }} \ - name: Wait for cluster ready state
-p"{{ galera_root_password }}" \ command: |
-e "show status like 'wsrep_incoming_addresses';" \ mysql -h {{ ansible_host }} \
--silent \ -p"{{ galera_root_password }}" \
--skip-column-names -e "show status like 'wsrep_incoming_addresses';" \
register: mysql_instance_ready --silent \
retries: 20 --skip-column-names
delay: 5 register: mysql_instance_ready
changed_when: false retries: 20
until: mysql_instance_ready is success 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 - name: Check cluster incoming addresses
command: | command: |
mysql -h {{ ansible_host }} \ mysql -h {{ ansible_host }} \

View File

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