ansible-mysql/tasks/replication/slave/gtid.yml

23 lines
624 B
YAML

---
- name: MYSQL_REPLICATION | Stop slave
mysql_replication:
mode: stopslave
- name: MYSQL_REPLICATION | Configure master host
mysql_replication:
mode: changemaster
master_host: "{{ mariadb_replication_host }}"
master_port: "{{ mariadb_replication_port }}"
master_user: "{{ mariadb_replication_user }}"
master_password: "{{ mariadb_replication_password }}"
no_log: "{{ not mariadb_debug_role }}"
- name: MYSQL_REPLICATION | Setup replication with GTID
mysql_replication:
primary_use_gtid: current_pos
- name: MYSQL_REPLICATION | Start slave
mysql_replication:
mode: startslave