Fix Galera bootstrap issues

pull/45/head
Steven Wheeler 2022-05-06 15:49:45 -05:00
parent 239ce0dd6c
commit c2f1ef522a
No known key found for this signature in database
GPG Key ID: FD77D8D821860ED3
3 changed files with 19 additions and 0 deletions

View File

@ -122,6 +122,8 @@ mariadb_upstream_version: '10.6'
# -------------------------------------
# Galera
# -------------------------------------
mariadb_galera_sst_user: galera
mariadb_galera_sst_password: galera
mariadb_galera_resetup: false
mariadb_wsrep_node_address: false # Set primary node IP
mariadb_galera_members: []

View File

@ -30,6 +30,16 @@
register: bootstrap_run
when: ansible_service_mgr != 'systemd'
- name: MYSQL_USER | Manage SST user...
community.mysql.mysql_user:
name: "{{ mariadb_galera_sst_user }}"
password: "{{ mariadb_galera_sst_password }}"
priv: "*.*:RELOAD,LOCK TABLES,REPLICATION CLIENT,PROCESS"
host: localhost
state: present
no_log: "{{ not mariadb_debug_role }}"
when: mariadb_galera_sst_user != ''
when: not s.stat.exists or mariadb_galera_resetup
- name: COMMAND | Create Bootstrap mark

View File

@ -33,3 +33,10 @@
state: started
when: debiancnf.stdout != ondc.stdout
- name: SERVICE | Restart MariaDB if needed
ansible.builtin.service:
name: "{{ mariadb_service_name }}"
state: restarted
when:
galeraconfig and bootstrap_run is defined and bootstrap_run['changed']