Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - stat: path=/etc/mysql/ansible.repl
- register: check_sql_path
- - name: create replicator user
- mysql_user:
- name: "replicator"
- host: "%"
- password: "{{ mypass.password_replication }}"
- priv: "*.*:REPLICATION SLAVE"
- state: present
- notify:
- - restart mysql
- - mysql_replication:
- mode: changemaster
- master_host: hostvars[inventory_hostname]['ansible_default_ipv4']['address']
- master_user: replicator
- master_password: "{{ mypass.password_replication }}"
- when: check_sql_path.stat.exists == false
- notify:
- - restart mysql
- - command: touch /etc/mysql/repl.ansible
- when: check_sql_path.stat.exists == false
- check_sql_path.stat.exists is false
- ==> site: TASK [mysql_replication] *******************************************************
- ==> site: fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "(1198, 'This operation cannot be performed with a running slave; run STOP SLAVE first'). Query == CHANGE MASTER TO ['MASTER_HOST=%(master_host)s', 'MASTER_USER=%(master_user)s', 'MASTER_PASSWORD=%(master_password)s']"}
- ==> site: to retry, use: --limit @/vagrant/ansible/playbook.retry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement