Bug 1696404
Summary: | Force Ansible to use Python 3 (python2-dnf used instead of python3-dnf) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kees de Jong <keesdejong+dev> |
Component: | ansible | Assignee: | Kevin Fenzi <kevin> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 30 | CC: | a.badger, athmanem, chad.dotson, kevin, kfenzi, maxim |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-04-04 19:39:25 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Kees de Jong
2019-04-04 19:14:56 UTC
For Fedora30+ machines (or any machines where python3 is installed and python2 is not) you should tell ansible to use python3 for that target: https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html In an upcoming ansible release, ansible may be able to auto detect what python you want to use, but thats not currently implemented. I don't think there's much we can do here... Yeah, this is working as designed in Ansible-2.7. Ansible-2.8+ will have a feature that you can turn on to autodetect the python interpreter to use on the remote machine: https://docs.ansible.com/ansible/devel/reference_appendices/interpreter_discovery.html The convenience comes at the cost of having to make additional round trips to the server. Depending on your network latency, it might be worthwhile to continue to set ansible_python_interpreter explicitly. I've tested that the feature chooses /usr/bin/python3 on Fedora 29 with multiple versions of python installed from the versioned python rpms. There could be bugs in other configurations, though, (for instance locally installing python from source or changing what /usr/bin/python3 refers to, or other platforms than Fedora) as there are a multitude of different scenarios out there. Ran into a similar issue with RHEL 7.7 Server. My issue is there doesn't appear to be a python3-dnf listed in the repository. Thoughts/ideas? |