Advertisement
Guest User

Untitled

a guest
Dec 24th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. - stat: path=/etc/mysql/ansible.repl
  2. register: check_sql_path
  3.  
  4. - name: create replicator user
  5. mysql_user:
  6. name: "replicator"
  7. host: "%"
  8. password: "{{ mypass.password_replication }}"
  9. priv: "*.*:REPLICATION SLAVE"
  10. state: present
  11. notify:
  12. - restart mysql
  13.  
  14. - mysql_replication:
  15. mode: changemaster
  16. master_host: hostvars[inventory_hostname]['ansible_default_ipv4']['address']
  17. master_user: replicator
  18. master_password: "{{ mypass.password_replication }}"
  19. when: check_sql_path.stat.exists == false
  20. notify:
  21. - restart mysql
  22.  
  23. - command: touch /etc/mysql/repl.ansible
  24. when: check_sql_path.stat.exists == false
  25.  
  26. check_sql_path.stat.exists is false
  27.  
  28. ==> site: TASK [mysql_replication] *******************************************************
  29. ==> 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']"}
  30. ==> site: to retry, use: --limit @/vagrant/ansible/playbook.retry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement