mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-04-09 13:42:10 +07:00
Better master and support MariaDB GTID
This commit is contained in:
12
tasks/detect_gtid.yml
Normal file
12
tasks/detect_gtid.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
- name: MYSQL_VARIABLES | Get MySQL vendor
|
||||
mysql_variables: variable=version_comment
|
||||
register: vc
|
||||
|
||||
- name: SET_FACT | Server can use GTID
|
||||
set_fact: mysql_gtid=true
|
||||
when: >
|
||||
( 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') )
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
- name: TEMPLATE Create .my.cnf for root
|
||||
template: src=root/my.cnf dest=/root/.my.cnf owner=root group=root mode=0600 backup=yes
|
||||
|
||||
- name: INCLUDE | Detect if server supports GTID
|
||||
include: detect_gtid.yml
|
||||
|
||||
- name: INCLUDE | Replication Master
|
||||
include: replication_master.yml
|
||||
when: mysql_replication_master
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
when: >
|
||||
mysql_vendor == 'mariadb' and
|
||||
slave_status.Using_Gtid == 'No' and
|
||||
mysql_mysql_gtid
|
||||
mysql_gtid
|
||||
|
||||
Reference in New Issue
Block a user