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
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: SERVICE | Stop MariaDB
|
2021-09-02 23:17:54 +07:00
|
|
|
ansible.builtin.service:
|
|
|
|
name: "{{ mariadb_service_name }}"
|
2018-03-18 00:28:56 +07:00
|
|
|
state: stopped
|
2016-09-23 22:03:13 +07:00
|
|
|
|
|
|
|
- name: COPY | Paste primary node's debian.cnf
|
2021-09-02 23:17:54 +07:00
|
|
|
ansible.builtin.copy:
|
2018-03-18 00:28:56 +07:00
|
|
|
content: "{{ debiancnf.stdout }}"
|
|
|
|
dest: /etc/mysql/debian.cnf
|
|
|
|
mode: 0600
|
|
|
|
owner: root
|
|
|
|
group: root
|
2016-09-23 22:03:13 +07:00
|
|
|
register: paste
|
|
|
|
|
|
|
|
- name: SERVICE | Start MariaDB
|
2021-09-02 23:17:54 +07:00
|
|
|
ansible.builtin.service:
|
|
|
|
name: "{{ mariadb_service_name }}"
|
2018-03-18 00:28:56 +07:00
|
|
|
state: started
|
2016-09-23 22:03:13 +07:00
|
|
|
|
|
|
|
when: debiancnf.stdout != ondc.stdout
|