I sign-up on this site to ask an question. How can I pass those master status information especially File and Position to an Ansible variable, to automate the processess of replication with an Ansible playbook.
Asked
Active
Viewed 306 times
1 Answers
1
I found some code bit's and wirte my solution.
vars:
masterhost: yourlocalhost
masterip: ip of your host 0.0.0.0
tasks:
- name: Get data from master file and position
mysql_replication:
mode: getmaster
register: master1data
- name: change master data
mysql_replication:
mode: changeprimary
master_host: '{{ masterip }}'
master_user: username
master_password: pass
master_log_file: '{{ master1data.File }}'
master_log_pos: '{{ master1data.Position }}'
DRAKON
- 21
- 2

