I am trying to move to python 3.6 on centos 7.8 and ansible 2.8.12
Mysql_db module fails importing connections from PyMySQL pip module.
At least with recent versions ( 0.9 ,1.0.2 ) using 0.7 pass.
the error seems to be related to a PEP recommendation E402 .
As per PyMySQL doc , python3 is supported .
here is my error:
{
“module_stdout”: “”,
“module_stderr”: “Traceback (most recent call last):\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 114, in \n _ansiballz_main()\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 49, in invoke_module\n imp.load_module(‘main’, mod, module, MOD_DESC)\n File "/tmp/ansible_mysql_db_payload_3i8jCj/main.py", line 110, in \n File "/tmp/ansible_mysql_db_payload_3i8jCj/ansible_mysql_db_payload.zip/ansible/module_utils/mysql.py", line 33, in \n File "/opt/venvs/py3_ansible28/lib/python3.6/site-packages/pymysql/init.py", line 59, in \n from . import connections # noqa: E402\n File "/opt/venvs/py3_ansible28/lib/python3.6/site-packages/pymysql/connections.py", line 167\n *,\n ^\nSyntaxError: invalid syntax\n”,
“exception”: “Traceback (most recent call last):\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 114, in \n _ansiballz_main()\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/var/lib/awx/.ansible/tmp/ansible-tmp-1617903869.1782537-29212-149280496397207/AnsiballZ_mysql_db.py", line 49, in invoke_module\n imp.load_module(‘main’, mod, module, MOD_DESC)\n File "/tmp/ansible_mysql_db_payload_3i8jCj/main.py", line 110, in \n File "/tmp/ansible_mysql_db_payload_3i8jCj/ansible_mysql_db_payload.zip/ansible/module_utils/mysql.py", line 33, in \n File "/opt/venvs/py3_ansible28/lib/python3.6/site-packages/pymysql/init.py", line 59, in \n from . import connections # noqa: E402\n File "/opt/venvs/py3_ansible28/lib/python3.6/site-packages/pymysql/connections.py", line 167\n *,\n ^\nSyntaxError: invalid syntax\n”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1,
“_ansible_no_log”: false,
“changed”: false
}