-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
ansible-test integration seems to be ignoring specified python version and interpreter #67699
Comments
Files identified in the description: If these files are inaccurate, please update the |
Apparently this is not a bug with
This basically means you have to set Therefore the following task which works fine on CentOS 6/7/8, Fedora 30+, Red Hat, etc. if using the system default Python does not work on CentOS 6/7 if you have Python 3 installed: - name: Ensure PHP packages are installed.
package:
name: "{{ php_packages }}"
state: "{{ php_packages_state }}"
enablerepo: "{{ php_enablerepo | default(omit, true) }}"
notify: restart webserver For CentOS 8, |
So a follow-up question—is there or will there ever be any way to use Python 3 on CentOS 6/7 or RHEL 6/7 and have Ansible work with it with |
Likely, no. But this isn't our decision necessarily. The OS package maintainers, while they have provided python3 for these older distros, have not packaged the yum or rpm python bindings for python3. It's possible we could completely rewrite the modules to shell out, instead of using the python bindings, but trying to parse stdout for making structured data would be nearly impossible. I don't see us realistically doing so. |
A few more notes:
So in the end, it looks like this is not an issue that Ansible itself can resolve, and the best option for me is to (sadly) continue using Python 2 on CentOS 7 and below, until support runs out (in ~2024 or so), or else rewrite any tasks where I'm using |
SUMMARY
For my php_roles collection build, I am using the following ansible-test command (see source):
When the integration tests are run, there are a number of notices about python requirements and versions, then some warnings like:
And when the integration playbook tasks are run, it seems they're trying to use the incorrect Python 2 environment in the Docker image, as I get errors like:
ISSUE TYPE
COMPONENT NAME
ansible-test
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
macOS or Linux (Ubuntu 18.04)
STEPS TO REPRODUCE
git clone https://github.com/geerlingguy/ansible-collection-php_roles.git
[collections path]/ansible_collections/geerlingguy/php_roles
php_roles
collectionansible-test integration --docker geerlingguy/docker-centos7-ansible --python 3.6 --python-interpreter /usr/bin/python3
EXPECTED RESULTS
Tests should pass, and Python 3 should be used as specified on the CLI.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: