Ansible 2.4 and yum tasks on CentOS 5

1,448 views
Skip to first unread message

John G

unread,
Sep 7, 2017, 5:42:35 PM9/7/17
to Ansible Project
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
---
- hosts: jgtest5c1
  user
: ansible
  become
: yes
  gather_facts
: false
  tasks
:

   
- block:
     
- yum: name=screen state=present
     
rescue:
     
- shell: "yum -y install screen"

[root@qaansible2 ansible]# tail -1 inv/qa/.hosts_ansible_testing
jgtest5c1 ansible_python_interpreter
=/usr/bin/python26



Toshio Kuratomi

unread,
Sep 8, 2017, 1:16:08 AM9/8/17
to ansible...@googlegroups.com
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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8a576346-f4bd-42e8-91db-94896dbda0a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages