title: ansible mysql replication fails to change master to due to 'Sending passwords in plain text without SSL/TLS is extremely insecure.'
body: <p>I'm setting up mysql replication with ansible mysql replication module, but got a failure:</p>
  
  <pre><code>TASK: [mysql | change the master in slave to start the replication] ***********
  failed: [mysql-master-1] =&gt; {"failed": true, "parsed": false}
  invalid output was: Change master
  Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 1714, in &lt;module&gt;
  main()
  File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 351, in main
  changemaster(cursor,chm)
  File "/root/.ansible/tmp/ansible-tmp-1414844287.9-261276925072204/mysql_replication", line 164, in changemaster
  cursor.execute("CHANGE MASTER TO " + SQLPARAM)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 175, in execute
  if not self._defer_warnings: self._warning_check()
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 89, in _warning_check
  warn(w[-1], self.Warning, 3)
  _mysql_exceptions.Warning: Sending passwords in plain text without SSL/TLS is extremely insecure.
  </code></pre>
  
  <p>The infrastrucure:</p>
  
  <pre><code>target servers:centos 6.4
  ansible: 1.7.2
  mysqldb:5.6.12-1.el6.x86_64
  </code></pre>
  
  <p>The playbook:</p>
  
  <pre><code>- name: change the master in slave to start the replication
    mysql_replication: &gt;
      mode=changemaster
      master_host={{ mysql_master_host }}
      master_user={{ mysql_repl_user }}
      master_password={{ mysql_repl_password }}
  </code></pre>
  
  <p>I tried setting the replication manually, it worked:</p>
  
  <pre><code>mysql&gt;change master to
       &gt;master_host='mysql-master-1'
       &gt;master_user='repl_user'
       &gt;master_password='123456';
  </code></pre>
  
  <p>It seems like the mysqldb python module fails to parse the command, how can I fix this without using ssl replication?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I modified the source file of "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py" by changing _defer_warning from False to True, issue fixed. But is there any more elegant solution?</p>