Michal Nasiadka 065bc80280 mariadb: switch to use mariadb flavored commands
MariaDB 11.4 does not include mysql* commands, so let's switch
to mariadb* equivalents, especially that mysql* ones are deprecated.

Change-Id: I6a3ac49f20d0a74198adc868c2a2260f7a6d5cfc
2024-11-27 16:20:09 +00:00

17 lines
667 B
YAML

---
# Explicitly wait for the database to be accessible via the load balancer.
# Sometimes it can reject connections even when all database services are up,
# due to the health check polling in HAProxy.
- name: Wait for MariaDB service to be ready through VIP
become: true
command: >
{{ kolla_container_engine }} exec {{ mariadb_service.container_name }}
mariadb -h {{ database_address }} -P {{ database_port }}
-u {{ mariadb_shard_database_user }} -p{{ database_password }} -e 'show databases;'
register: result
until: result is success
changed_when: False
retries: 6
delay: 10
when: mariadb_shard_id == mariadb_default_database_shard_id