mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-03-14 11:42:09 +07:00
Replication tasks in seperated directory
This commit is contained in:
@@ -30,16 +30,9 @@
|
|||||||
- name: TEMPLATE Create .my.cnf for root
|
- name: TEMPLATE Create .my.cnf for root
|
||||||
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes
|
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes
|
||||||
|
|
||||||
- name: INCLUDE | Detect if server supports GTID
|
- name: INCLUDE | Replication
|
||||||
include: detect_gtid.yml
|
include: replication/main.yml
|
||||||
|
when: mysql_replication_master or mysql_replication_slave
|
||||||
- name: INCLUDE | Replication Master
|
|
||||||
include: replication_master.yml
|
|
||||||
when: mysql_replication_master
|
|
||||||
|
|
||||||
- name: INCLUDE | Replication slave
|
|
||||||
include: replication_slave.yml
|
|
||||||
when: mysql_replication_slave
|
|
||||||
|
|
||||||
- name: INCLUDE | Secure install
|
- name: INCLUDE | Secure install
|
||||||
include: 'secure.yml'
|
include: 'secure.yml'
|
||||||
|
|||||||
@@ -10,3 +10,11 @@
|
|||||||
( mysql_vendor == 'mariadb' and vc.msg[0][1] | version_compare('10.0.2', 'ge') ) or
|
( mysql_vendor == 'mariadb' and vc.msg[0][1] | version_compare('10.0.2', 'ge') ) or
|
||||||
( vc.msg[0][1] | version_compare('5.6.5', 'ge') )
|
( vc.msg[0][1] | version_compare('5.6.5', 'ge') )
|
||||||
|
|
||||||
|
- name: INCLUDE | Replication Master
|
||||||
|
include: master.yml
|
||||||
|
when: mysql_replication_master
|
||||||
|
|
||||||
|
- name: INCLUDE | Replication slave
|
||||||
|
include: slave.yml
|
||||||
|
when: mysql_replication_slave
|
||||||
|
|
||||||
5
tasks/replication/master.yml
Normal file
5
tasks/replication/master.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: TEMPLATE | Deploy master configuration
|
||||||
|
template: src=../templates/etc/mysql/conf.d/50-master.cnf.j2 dest=/etc/mysql/conf.d/50-master.cnf
|
||||||
|
notify: restart mysql
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
when: mysql_slave_readonly
|
when: mysql_slave_readonly
|
||||||
|
|
||||||
- name: TEMPLATE | Deploy slave configuration
|
- name: TEMPLATE | Deploy slave configuration
|
||||||
template: src=etc/mysql/conf.d/51-slave.cnf.j2 dest=/etc/mysql/conf.d/51-slave.cnf
|
template: src=../templates/etc/mysql/conf.d/51-slave.cnf.j2 dest=/etc/mysql/conf.d/51-slave.cnf
|
||||||
notify: restart mysql
|
notify: restart mysql
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Get slave status
|
- name: MYSQL_REPLICATION | Get slave status
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: TEMPLATE | Deploy master configuration
|
|
||||||
template: src=etc/mysql/conf.d/50-master.cnf.j2 dest=/etc/mysql/conf.d/50-master.cnf
|
|
||||||
notify: restart mysql
|
|
||||||
Reference in New Issue
Block a user