Ansible 2.4 and yum tasks on CentOS 5

I installed python26 from the epel repo on CentOS 5. The yum module fails. Is there a better option than to fall back and use the shell module to run yum commands?

`
[root@qaansible2 ansible]# rpm -q ansible
ansible-2.4.0.0-0.1.rc1.201709070239git.9ff5ac3.el7.ans.noarch
[root@qaansible2 ansible]# ansible-playbook rhel5_python26_test.yml -i inv/qa/.hosts_ansible_testing
[DEPRECATED] ACCELERATE_TIMEOUT: Removing accelerate as a connection method, settings not needed either… It will be removed in 2.5. As alternative use one of [ssh and paramiko]
[DEPRECATED] DEFAULT_SUDO_FLAGS: In favor of become which is a generic framework. It will be removed in 2.8. As alternative use one of [become]
[DEPRECATED] ACCELERATE_DAEMON_TIMEOUT: Removing accelerate as a connection method, settings not needed either… It will be removed in 2.5. As alternative use one of [ssh and paramiko]
[DEPRECATED] ACCELERATE_CONNECT_TIMEOUT: Removing accelerate as a connection method, settings not needed either… It will be removed in 2.5. As alternative use one of [ssh and paramiko]
[DEPRECATED] DEFAULT_SUDO_EXE: In favor of become which is a generic framework. It will be removed in 2.8. As alternative use one of [become]
[DEPRECATED] DEFAULT_SUDO_USER: In favor of become which is a generic framework. It will be removed in 2.8. As alternative use one of [become]
[DEPRECATED] ACCELERATE_PORT: Removing accelerate as a connection method, settings not needed either… It will be removed in 2.5. As alternative use one of [ssh and paramiko]

PLAY [jgtest5c1] ********************************************************************************************************************************************************************************************************

TASK [yum] ********************************************************************************************************************************************************************************************************
fatal: [jgtest5c1]: FAILED! => {“changed”: false, “failed”: true, “msg”: “python2 bindings for rpm are needed for this module. python2 yum module is needed for this module”}

TASK [command] ********************************************************************************************************************************************************************************************************
[WARNING]: Consider using yum module rather than running yum

changed: [jgtest5c1]

PLAY RECAP ********************************************************************************************************************************************************************************************************
jgtest5c1 : ok=1 changed=1 unreachable=0 failed=1
`

`
[root@qaansible2 ansible]# cat rhel5_python26_test.yml

You appear to need the yum python module for the python2.6 install. That may not be an easy undertaking. If you do want to try it, I’d start with the yum rpm for CentOS 6 as CentOS 6 also used python2.6. Experience building software from source is recommended. If you don’t have this then running via the shell module may already be the better option for you.

-Toshio