add galera.cnf for first node

This commit is contained in:
Egon Rijpkema
2017-10-17 17:12:52 +02:00
parent 9e877a1e63
commit fdb5320429
3 changed files with 23 additions and 0 deletions

View File

@ -31,6 +31,20 @@
dest: /srv/mariadb/etc/mysql
mode: 660
- name: Set galara.cnf on first node if we have at least three nodes.
copy:
src: files/galera-master.cnf
dest: /srv/mariadb/etc/mysql/conf.d/galera.cnf
mode: 660
when: ansible_nodename == hostname_node0 and hostvars[groups['mariadb']]|length >= 3
- name: Set galara.cnf on other nodes if we have at least three nodes.
copy:
src: files/galera-slave.cnf
dest: /srv/mariadb/etc/mysql/conf.d/galera.cnf
mode: 660
when: ansible_nodename != hostname_node0 and hostvars[groups['mariadb']]|length >= 3
- command: systemctl daemon-reload
- name: make sure service is started