mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-09-11 01:55:26 +07:00
Only restart the other nodes when bootstrapping
This commit is contained in:
+15
-2
@@ -1,4 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- name: SET_FACT | Prepare mark var
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
__mark: "{{ mariadb_datadir }}/.ansible_galera_boostrap"
|
||||||
|
|
||||||
|
- name: STAT | Bootstrap mark
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ __mark }}"
|
||||||
|
register: s
|
||||||
|
|
||||||
- name: COMMAND | GET debian.cnf from primary node
|
- name: COMMAND | GET debian.cnf from primary node
|
||||||
ansible.builtin.command: cat /etc/mysql/debian.cnf
|
ansible.builtin.command: cat /etc/mysql/debian.cnf
|
||||||
@@ -38,5 +46,10 @@
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: "{{ mariadb_service_name }}"
|
name: "{{ mariadb_service_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
throttle: 1
|
||||||
galeraconfig and bootstrap_run is defined and bootstrap_run['changed']
|
when: not s.stat.exists or mariadb_galera_resetup
|
||||||
|
|
||||||
|
- name: COMMAND | Create Bootstrap mark
|
||||||
|
ansible.builtin.command: "touch {{ __mark }}"
|
||||||
|
args:
|
||||||
|
creates: "{{ __mark }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user