ansible-mysql/tasks/galera/nodes.yml

36 lines
737 B
YAML
Raw Normal View History

---
- 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 }}'
changed_when: false
- name: COMMAND | Get current debian.cnf
command: cat /etc/mysql/debian.cnf
register: ondc
changed_when: false
- block:
- name: SERVICE | Stop MariaDB
2018-03-18 00:28:56 +07:00
service:
name: mysql
state: stopped
- 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
register: paste
- name: SERVICE | Start MariaDB
2018-03-18 00:28:56 +07:00
service:
name: mysql
state: started
when: debiancnf.stdout != ondc.stdout