ansible-mysql/tasks/galera/main.yml

22 lines
682 B
YAML
Raw Normal View History

---
- name: TEMPLATE | Deploy Galera configuration
template: src=etc/mysql/conf.d/09-galera.cnf.j2 dest=/etc/mysql/conf.d/09-galera.cnf
register: galeraconfig
- name: INCLUDE | Bootstrap first node
include: 'bootstrap.yml'
when: inventory_hostname == mysql_galera_primary_node
- name: INCLUDE | Configure other nodes
include: 'nodes.yml'
when: inventory_hostname != mysql_galera_primary_node
- name: SERVICE | Restart MariaDB if needed
service: name=mysql state=restarted
when: >
2016-10-03 17:30:26 +07:00
((galeraconfig or (p is defined and p.changed)) and
(bootstrap_run is not defined)) or
((inventory_hostname != mysql_galera_primary_node) and
(mysql_galera_resetup))