[CentOS7] Use dnf if Py3 (Py2/yum vs. Py3/dnf) #1

Open
opened 2020-10-06 14:17:03 +00:00 by svelt · 0 comments
Owner

CentOS 7, Python3.6, Module "yum":

TASK [epel : Update CA-Certificates] **********************************************************************************************************************************
fatal: [centos7]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the `dnf` Ansible module instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead."}

setup detects "wrong" package manager:

# ansible centos7 -m setup -a 'filter=*pkg*'
centos7 | SUCCESS => {
    "ansible_facts": {
        "ansible_pkg_mgr": "yum"
    },
    "changed": false}
centos7 | SUCCESS => {
    "ansible_facts": {
        "ansible_python_version": "3.6.8"
    },
    "changed": false
}

CentOS 7, Python3.6, Module "yum": ``` TASK [epel : Update CA-Certificates] ********************************************************************************************************************************** fatal: [centos7]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the `dnf` Ansible module instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead."} ``` `setup` detects "wrong" package manager: ``` # ansible centos7 -m setup -a 'filter=*pkg*' centos7 | SUCCESS => { "ansible_facts": { "ansible_pkg_mgr": "yum" }, "changed": false} ``` ```# ansible centos7 -m setup -a 'filter=*python_version*' centos7 | SUCCESS => { "ansible_facts": { "ansible_python_version": "3.6.8" }, "changed": false } ```
svelt changed title from [CentOS7] Py2/yum vs. Py3/dnf to [CentOS7] Use dnf if Py3 (Py2/yum vs. Py3/dnf) 2020-10-06 14:22:17 +00:00
svelt self-assigned this 2021-10-29 14:12:50 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Ansible/epel-simplified#1
No description provided.