2016-09-23 22:03:13 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: COMMAND | GET debian.cnf from primary node
|
|
|
|
command: cat /etc/mysql/debian.cnf
|
|
|
|
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
|
|
|
|
command: cat /etc/mysql/debian.cnf
|
|
|
|
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
|
2018-03-18 00:28:56 +07:00
|
|
|
service:
|
|
|
|
name: mysql
|
|
|
|
state: stopped
|
2016-09-23 22:03:13 +07:00
|
|
|
|
|
|
|
- name: COPY | Paste primary node's debian.cnf
|
2018-03-18 00:28:56 +07:00
|
|
|
copy:
|
|
|
|
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
|
2018-03-18 00:28:56 +07:00
|
|
|
service:
|
|
|
|
name: mysql
|
|
|
|
state: started
|
2016-09-23 22:03:13 +07:00
|
|
|
|
|
|
|
when: debiancnf.stdout != ondc.stdout
|