Bug 1260191 - ansible should use python3
Summary: ansible should use python3
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: ansible
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-04 16:54 UTC by Orion Poplawski
Modified: 2016-10-02 07:59 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-04 17:10:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2015-09-04 16:54:15 UTC
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):
1.9.3-1.fc24

Comment 1 Kevin Fenzi 2015-09-04 16:59:19 UTC
ansible isn't ported to python3 upstream. 

Can you expand on what error you are getting and what you have installed?

Comment 2 Orion Poplawski 2015-09-04 17:02:47 UTC
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.

Comment 3 Orion Poplawski 2015-09-04 17:06:02 UTC
Perhaps use of Recommends would be appropriate here.

Comment 4 Kevin Fenzi 2015-09-04 17:10:49 UTC
(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?

Comment 5 Mike Goodwin 2016-08-17 00:16:19 UTC
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?

Comment 6 Mike Goodwin 2016-10-02 07:59:35 UTC
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
      become: yes
      when:
        - ansible_distribution == "Fedora"
        - ansible_pkg_mgr == "dnf"
        - ansible_distribution_major_version|int >= 23


Note You need to log in before you can comment on or make changes to this bug.