"msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed for this module"

  • 1
  • Question
  • Updated 3 months ago
When I execute an comman to install httpd via yum to some controlled agent, it failed and poping out with the errors as below:

[root@localhost ansible]# ansible lab -m yum -a "name=bwm-ng state=present" 
192.168.139.143 | FAILED! => {
    "changed": false, 
    "msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed for this  module"
}
192.168.139.144 | FAILED! => {
    "changed": false, 
    "msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed for this  module"
}
[root@localhost ansible]# 

Not sure if someone met this issue before?  I am new to Ansible, forgive the entry level questions. 

Thanks 
Paul 
Photo of Paul Zhang

Paul Zhang

  • 70 Points

Posted 3 months ago

  • 1
Photo of Eric Pulvino

Eric Pulvino, Official Rep

  • 4,082 Points 4k badge 2x thumb
Paul, Cumulus Linux is Debian based this means you'll need to use the apt module ( http://docs.ansible.com/ansible/latest/apt_module.html ) to install software instead of the yum module. Yum is used for RHEL based linux versions.

- name: Add the Jessie Supplemental Repo
  apt_repository:
    repo: deb http://repo3.cumulusnetworks.com/repo Jessie-supplemental upstream
    state: present
    filename: 'jessie_supplemental'
- name: Install "bwm-ng" package
  apt:
    name: bwm-ng
    update_cache: yes