2016-09-23 22:03:13 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: COMMAND | GET debian.cnf from primary node
|
2021-09-02 23:17:54 +07:00
|
|
|
ansible.builtin.command: cat /etc/mysql/debian.cnf
|
2016-09-23 22:03:13 +07:00
|
|
|
register: debiancnf
|
2018-03-17 23:28:54 +07:00
|
|
|
delegate_to: '{{ mariadb_galera_primary_node }}'
|
2016-09-27 22:37:43 +07:00
|
|
|
changed_when: false
|
2016-09-23 22:03:13 +07:00
|
|
|
|
|
|
|
- name: COMMAND | Get current debian.cnf
|
2021-09-02 23:17:54 +07:00
|
|
|
ansible.builtin.command: cat /etc/mysql/debian.cnf
|
2016-09-23 22:03:13 +07:00
|
|
|
register: ondc
|
2016-09-27 22:37:43 +07:00
|
|
|
changed_when: false
|
2016-09-23 22:03:13 +07:00
|
|
|
|
2024-08-26 15:12:09 +07:00
|
|
|
- name: BLOCK | Compare debian.cnf
|
|
|
|
when: debiancnf.stdout != ondc.stdout
|
|
|
|
block:
|
2016-09-23 22:03:13 +07:00
|
|
|
|
2024-08-26 15:12:09 +07:00
|
|
|
- name: SERVICE | Stop MariaDB
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: "{{ mariadb_service_name }}"
|
|
|
|
state: stopped
|
2016-09-23 22:03:13 +07:00
|
|
|
|
2024-08-26 15:12:09 +07:00
|
|
|
- name: COPY | Paste primary node's debian.cnf
|
|
|
|
ansible.builtin.copy:
|
|
|
|
content: "{{ debiancnf.stdout }}"
|
|
|
|
dest: /etc/mysql/debian.cnf
|
|
|
|
mode: 0600
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
register: paste
|
2016-09-23 22:03:13 +07:00
|
|
|
|
2024-08-26 15:12:09 +07:00
|
|
|
- name: SERVICE | Start MariaDB
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: "{{ mariadb_service_name }}"
|
|
|
|
state: started
|