ansible-mysql/tasks/galera/nodes.yml

36 lines
929 B
YAML
Raw Normal View History

---
- name: COMMAND | GET debian.cnf from primary node
ansible.builtin.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
ansible.builtin.command: cat /etc/mysql/debian.cnf
register: ondc
changed_when: false
2024-08-26 15:12:09 +07:00
- name: BLOCK | Compare debian.cnf
when: debiancnf.stdout != ondc.stdout
block:
2024-08-26 15:12:09 +07:00
- name: SERVICE | Stop MariaDB
ansible.builtin.service:
name: "{{ mariadb_service_name }}"
state: stopped
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
2024-08-26 15:12:09 +07:00
- name: SERVICE | Start MariaDB
ansible.builtin.service:
name: "{{ mariadb_service_name }}"
state: started