Yum Module - EL6 Systems Permission denied

HI all!

I try to install some packages via the Ansible yum Module on CentOS 6 (python --version
Python 2.6.6) systems but I getting the following error:

I’ve started the Module-Script with root - permission
/dev/shm/ansible-tmp-root/ansible-tmp-1491206776.36-130095664290190/yum.py

error message

{“msg”: “[Errno 13] Permission denied”, “failed”: true, “cmd”: “/etc/rpm -q --qf ‘%{name}-%{version}-%{release}.%{arch}’ libselinux-python”, “rc”: 13, “invocation”: {“module_args”: {“name”: [“libselinux-python”, “ntp”], “list”: null, “disable_gpg_check”: false, “conf_file”: null, “install_repoquery”: true, “state”: “installed”, “disablerepo”: null, “update_cache”: false, “enablerepo”: null, “exclude”: null, “validate_certs”: true}}}

On my CentOS7 systems works the same very well.

Any Ideas?

Thanks in advance

Martin

I'm guessing the system doesnt have 'repoquery' installed, and that is
potentially causing the plugin to lookup where rpm lives and for
whatever reason it is deciding rpm executable lives in /etc/rpm.

ie the result of
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/packaging/os/yum.py#L351
is setting rpmbin='/etc/rpm'

No idea why it would find /etc/rpm though.

is '/etc' in PATH?

I do see what is almost surely a bug in
module_utils.basic.get_bin_path() though. It sets a default default
arg to a mutable , which can cause unexpected behavior. But I dont
see any thing in particular that seems like it would cause the bug.