MYSQL Connectivity Issue in Ansible

22 views
Skip to first unread message

Mona Gopal

unread,
Jan 3, 2017, 11:48:57 PM1/3/17
to Ansible Project
Hello,

I have the below task 

mysql_user: login_user={{ db_user_root }} login_password={{ db_pass_root }} name={{ db_user }} password={{ db_pass }} priv=*.*:ALL,GRANT state=present


We're facing issue on running this, from machine B to install on machine A. Installing from machine A to machine B is running fine.


However, by specifying login_host parameter this works fine.

But, the same parameter is not essential while running from A to B.

What could be the scenario?? why is that login_host parameter is required when running from B to A and not vice versa.



Thanks in advance,

Mona G

Toshaan Bharvani | VanTosh

unread,
Jan 4, 2017, 4:40:22 AM1/4/17
to ansible...@googlegroups.com
I would be guessing, because you do not give enough information.
I presume that your server my.cnf bind only to an IP on machine A, while
machine B has a UNIX socket connection, the default MySQL python module
uses a UNIX socket connection, while you can override that by using the
'login_host' variable and then the module will use a TCP socket
Another possibility is that your user running the Ansible task has a
.my.cnf in $HOME which overrides the default host value, so you need to
specify the correct one manually

However this is a wild guess, for a better answer, more information is
required.

>
>
>
> Thanks in advance,
>
> Mona G
Regards,
Tosh.





Mona Gopal

unread,
Jan 4, 2017, 4:55:57 AM1/4/17
to Ansible Project, tos...@vantosh.com
Dear Tosh,

Thanks a lot for your response :)
We are checking on the parameters that you mentioned.
Can  you list out what more information is required for a better analysis of the same.

Regards,
Mona G 

Toshaan Bharvani | VanTosh

unread,
Jan 4, 2017, 6:42:25 AM1/4/17
to ansible...@googlegroups.com
Mona,

> Dear Tosh,
>
> Thanks a lot for your response :)
> We are checking on the parameters that you mentioned.
> Can you list out what more information is required for a better
> analysis of the same.
>
Well, Ansible log, MySQL logs and configs
I do not think it is actually Ansible.
Remember to sanitized all credentials.



> Regards,
> Mona G
>

Regards,
Tosh.
Reply all
Reply to author
Forward
0 new messages