Skip to content
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

Fix for Python2 and the dnf module for Fedora. #42

Merged
merged 1 commit into from Nov 6, 2019

Conversation

@sadsfae
Copy link
Owner

sadsfae commented Nov 6, 2019

Fedora 30 obsoleted python2-dnf and this causes issues with
referencing the Ansible 'dnf' module.

Instead, you should just set your system Python to Python3 in most cases
which may also not be the case on Fedora 30.

This does the following if the system is >= EL8 or Fedora:

  1. tries to create a symlink from /usr/bin/python3 to /usr/bin/python
  2. barring that, tries to use the alternatives command to set your
    system python to Python3

alternatives --install /usr/bin/python python /usr/bin/python3 1

Without these steps the Ansible dnf module will not work.

Fedora31 and above or any system that already has their python version
set to python3 shouldn't have issues.

ansible/ansible#54855

On Fedora 30 obsoleted python2-dnf and this causes issues with
referencing the Ansible 'dnf' module.

Instead, you should just set your system Python to Python3 in most cases
which may also not be the case on Fedora 30.

This does the following if the system is >= EL8 or Fedora:

1) tries to create a symlink from /usr/bin/python3 to /usr/bin/python
2) barring that, tries to use the alternatives command to set your
system python to Python3

alternatives --install /usr/bin/python python /usr/bin/python3 1

Without these steps the Ansible dnf module will not work.

Fedora31 and above or any system that already has their python version
set to python3 shouldn't have issues.

ansible/ansible#54855
@sadsfae sadsfae merged commit 5d601b8 into master Nov 6, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.