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

26 lines
784 B
YAML
Raw Normal View History

---
- name: MYSQL_REPLICATION | Stop slave
2018-03-18 00:28:56 +07:00
mysql_replication:
mode: stopslave
- name: MYSQL_REPLICATION | Configure master host
2018-03-18 00:28:56 +07:00
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 | Change master
2018-03-18 00:28:56 +07:00
mysql_replication:
mode: changemaster
master_log_file: "{{ mariadb_master_log_file }}"
master_log_pos: "{{ mariadb_master_log_pos }}"
2018-03-17 23:28:54 +07:00
when: mariadb_master_log_file is defined and mariadb_master_log_pos is defined
- name: MYSQL_REPLICATION | Start slave
2018-03-18 00:28:56 +07:00
mysql_replication:
mode: startslave