Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lemp_ubuntu1804 playbook ends with PyMySQL failure #6

Open
eran101 opened this issue Aug 7, 2020 · 1 comment
Open

lemp_ubuntu1804 playbook ends with PyMySQL failure #6

eran101 opened this issue Aug 7, 2020 · 1 comment

Comments

@eran101
Copy link

eran101 commented Aug 7, 2020

This is how the playbook ends:

TASK [Sets the root password] *****************************************************************************************************
[WARNING]: Module did not set no_log for update_password
fatal: [localhost]: FAILED! => {"changed": false, "msg": "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."}

RUNNING HANDLER [Reload Nginx] ****************************************************************************************************

PLAY RECAP ************************************************************************************************************************
localhost : ok=6 changed=5 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

The PyMySQL was already installed when the playbook finished:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pymysql is already the newest version (0.8.0-1).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded. ```
@leniquenoralez
Copy link

@eran101 I was getting this same error as well. In vars/default.yml file I added ansible_python_interpreter: "/usr/bin/python3"

There was also a prior warning in the terminal "[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host default should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with
prior Ansible releases."

In the playbook Ansible is installing "python3-pymysql" and using the python 2.7 interpreter to execute the package which is a python 3 package.

Telling Ansible to use the Python 3 interpreter fixed the error.

source: Interpreter Discovery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants