geerlingguy / ansible-role-mysql

Ansible Role - MySQL
https://galaxy.ansible.com/geerlingguy/mysql/
MIT License
1.05k stars 865 forks source link

The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required. #410

Closed sampsont closed 3 years ago

sampsont commented 4 years ago

All of a sudden, I'm getting the following error: TASK [geerlingguy.mysql : Ensure default user is present.] ***** [WARNING]: Module did not set no_log for update_password fatal: [10.0.1.2]: FAILED! => { "changed": false } MSG: The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required.

The controller host is Ubuntu 18.04. The target host is Ubuntu 18.04.

dfr@m9kansible:~/m9kdeploy/playbooks$ ansible --version ansible 2.9.12 config file = /home/dfr/m9kdeploy-18/playbooks/ansible.cfg configured module search path = [u'/home/dfr/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/dist-packages/ansible executable location = /usr/bin/ansible python version = 2.7.17 (default, Jul 20 2020, 15:37:01) [GCC 7.5.0]

I can install PyMySQL on the target but it doesn't help. If I try to install MySQL-python on the target, I get this error: dfr@m9kmission:~$ sudo -H pip install MySQL-python Collecting MySQL-python Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-v0MZL5/MySQL-python/setup.py", line 17, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v0MZL5/MySQL-python/

It used to work. I don't know what could have happened. Could you give me any clues? Thanks! Todd

sampsont commented 4 years ago

I'm using the same ansible code to port to Ubuntu 20.04. I put the following in my ansible.cfg file: interpreter_python = /usr/bin/python3 I took this back out and now the Ubuntu 18.04 environment works. Thanks

john-999 commented 4 years ago

I just ran into this, too...

stale[bot] commented 3 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 3 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.