Red Hat Bugzilla – Bug 1260191
ansible should use python3
Last modified: 2016-10-02 03:59:35 EDT
Description of problem:
At least on f24, perhaps on f23, ansible should use python3. dnf module doesn't work out of the box because ansible is looking for the python2 dnf module but dnf is python3 by default.
Version-Release number of selected component (if applicable):
ansible isn't ported to python3 upstream.
Can you expand on what error you are getting and what you have installed?
On a default install I get:
ImportError: No module named dnf
workaround is to install python-dnf to get the python2 dnf module. So, not a show stopper, but obviously it would be good to have the two in sync.
Perhaps use of Recommends would be appropriate here.
(In reply to Orion Poplawski from comment #3)
> Perhaps use of Recommends would be appropriate here.
Nope. We don't know what machine is running that module... recommends could only apply to the master/management node that has ansible on it, not all the nodes it's managing.
I don't think there's really anything we can do here.
Upstream hasn't ported to python3 yet, so we need them to do that before ansible is python3.
Only thing I can think of is perhaps to ask upstream to add a better error message there telling you to install python-dnf?
Wouldn't this be the package/yum module that's looking for the wrong DNF or....?
It's not importing dnf on the host system, is it?
For anyone that comes across this, the workaround for this if you are managing Fedora systems:
- name: Bootstrap DNF on Fedora >= 23
raw: dnf install -y python2-dnf
- ansible_distribution == "Fedora"
- ansible_pkg_mgr == "dnf"
- ansible_distribution_major_version|int >= 23