Closed thorian93 closed 3 years ago
To elaborate: This does not happen on Ubuntu 20.04.
As a quick&dirty workaround you can do something like mysql_packages: ['mariadb-server', 'python-pymysql', 'python3-pymysql']
in your variable section.
Hmm... also see https://github.com/geerlingguy/ansible-role-mysql/issues/445
On RHEL 8, python3-PyMySQL
is in the dependencies installed.
On Debian 10, I only have default-mysql-server
. Maybe installing python3-pymysql
would fix this?
Hmm... that might not be the best way. Also, the mysql collection is reverting the change that started producing errors on RHEL 7 systems.
I might be totally of course here, but would it be an idea to define those prerequisites in the OS-specific variable files once they become necessary? I do that in some of my roles and it works arguably good. Also you already have some of those files in use. That way you can go with the defaults as long as they work but you are able to set specific packages for specific distributions.
I just realized that this issue depends on the python interpreter. Forcing Ansible to use Python 3 solves the issue. Apparently the problem is Python 2 and the related packages. Is this even something you want to address @geerlingguy or do you see that as out of scope for your role?
@thorian93 - Since this seems to be something that could be very environment/OS-dependent, I'd rather not try to solve the python package problem in this role (unless it's something in this role that is causing the issue).
No forcing ansible to use python3 doesn't fix this.. it is showing up in community.mysql as well.. for some reason ansible can't see pymysql - even if it is asked to install it itself.
Interesting, for me it worked. I will keep an eye on it and update if I find anything worth mentioning.
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.
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.
Setting my python interpreter doesn't seem to fix this issue for me. If I do "molecule converge" twice, the 2nd run will work. The 1st will fail. I'm a little confused about why this happens, though.
Setting the mysql_packages
variable as @1977er recommended seems to work, but now I get another error at "geerlingguy.mysql : Remove MySQL test database.". This is on ubuntu:18.04
I figured out a solution that works for me. I had to install python3.6 manually (or, in prepare.yml). Then I define that as my interpreter: ansible_python_interpreter: /usr/bin/python3.6
. I tested with python3.8 and ended up with the same issue.
Python interpreter: Python 2
Affected OS:
I took the role as is and ran it against the server which got me the following message:
As far as I understand the role should make sure the proper Python modules are installed, right? I build my own role some time ago and took care of that but I can not figure out, why this does not work here. Any hint to what I am doing wrong?