Fix galera_force_bootstrap behaviour

Currently, ``galera_force_bootstrap`` fuctionality is eqivalent to
``galera_ignore_cluster_state`` and not really functional.
We add extra conditions to cluster bootstrap handlers that allow
to force bootstrap cluster when it's already running.

This could also be leveraged while stretching galera cluster.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/821415
Change-Id: I0380782a034d291fd2173c2ae59fdfb8f4468bf0
This commit is contained in:
Dmitriy Rabotyagov 2021-12-24 16:49:56 +02:00
parent c998a14d82
commit 47d708e161
1 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@
listen: Bootstrap cluster
when:
- galera_install_server | bool
- not galera_cluster_ready | bool
- not galera_cluster_ready | bool or galera_force_bootstrap | bool
- name: Start new cluster
command: /usr/local/bin/galera_new_cluster
@ -70,13 +70,13 @@
run_once: true
when:
- galera_install_server | bool
- not galera_cluster_ready | bool
- not galera_cluster_ready | bool or galera_force_bootstrap | bool
listen: Bootstrap cluster
- name: Restart mysql (All)
service:
name: "{{ galera_mariadb_service_name }}"
state: "{{ (not hostvars[item]['galera_cluster_ready'] | bool) | ternary('started', 'restarted') }}"
state: "{{ (not hostvars[item]['galera_cluster_ready'] | bool or galera_force_bootstrap | bool) | ternary('started', 'restarted') }}"
enabled: yes
environment:
MYSQLD_STARTUP_TIMEOUT: 180