Only restart the other nodes when bootstrapping

pull/45/head
Steven Wheeler 2022-05-06 16:44:28 -05:00
parent c2f1ef522a
commit d957d31678
No known key found for this signature in database
GPG Key ID: FD77D8D821860ED3
1 changed files with 15 additions and 2 deletions

View File

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