mysql_user module error: mysql-python on Mac OSX

22 views
Skip to first unread message

Stephen Mah

unread,
Sep 2, 2017, 12:23:30 AM9/2/17
to Ansible Project
I'm having the following issue on my Mac running

I'm trying to run an ansible-playbook and it bombs out with the following mysql_user command: 
mysql_user: name=mmuser password={{ mysql_root_password }} priv='*.*:ALL' state=present

TASK [database : create mmuser] ****************************************************************************************************************
fatal: [192.168.34.11]: FAILED! => {"changed": false, "failed": true, "msg": "the python mysqldb module is required"}

I have a few versions of Python installed. Apologies, as I'm pretty new to Python and Ansible. I must of ran an update at some point.
I'm assuming Ansible is using 2.7.13, but /usr/bin/python is version 2.7.10.
How do I resolve this?

My environment is MacOS version 10.12.6

ansible --version

ansible 2.3.1.0

 python version = 2.7.13 |Anaconda 4.3.1 (x86_64)| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Stephens-MacBook-Pro:~ steve$ pip list |grep -i mysql

MySQL-python (1.2.5)

Stephens-MacBook-Pro:~ steve$ which python

/Users/steve/anaconda/bin/python

 

# ansible --version

ansible 2.3.1.0

python version = 2.7.13 |Anaconda 4.3.1 (x86_64)| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

 

ROOT USER:

Stephens-MacBook-Pro:~ root# which python

/usr/bin/python

Stephens-MacBook-Pro:~ root# which python

/usr/bin/python

Stephens-MacBook-Pro:~ root# python --version

Python 2.7.10


pip list|grep -i mysql

MySQL-python (1.2.5)


thanks for the help


-Steve

Reply all
Reply to author
Forward
0 new messages