Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Mysql - Check master replication status.
- mysql_replication: mode=getmaster
- register: master
- when: mysql_replication and ansible_eth0.ipv4.address == replication_master
- - name: Mysql - Configure replication on the slave.
- mysql_replication:
- mode: changemaster
- master_host: "{{ replication_master }}"
- master_user: "{{ replication_user }}"
- master_password: "{{ replication_pass }}"
- master_log_file: "{{ master.File }}"
- master_log_pos: "{{ master.Position }}"
- ignore_errors: True
- when: mysql_replication and (ansible_eth0.ipv4.address != replication_master)
Add Comment
Please, Sign In to add comment