Ansible Playbook Doesn't run on RHEL 4.x

323 views
Skip to first unread message

Mona Gopal

unread,
Aug 22, 2016, 3:34:42 AM8/22/16
to Ansible Project, sandhy...@gmail.com
Hi,

My ansible playbook works on 6.x and the same fails with the below error on 4.x

Error is:

fatal: [172.19.1.239]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1471850606.58-237797342898160/setup\", line 10, in ?\r\n    import subprocess\r\nImportError: No module named subprocess\r\n", "msg": "MODULE FAILURE", "parsed": false}


4.x has python2.7 installed on it /usr/local/bin.


Could you please help a way forward


Thanks in advance,

Mona G



Kai Stian Olstad

unread,
Aug 22, 2016, 3:45:05 AM8/22/16
to ansible...@googlegroups.com
On 22. aug. 2016 09:34, Mona Gopal wrote:
> My ansible playbook works on 6.x and the same fails with the below error on
> 4.x
>
> Error is:
>
> fatal: [172.19.1.239]: FAILED! => {"changed": false, "failed": true,
> "module_stderr": "", "module_stdout": "Traceback (most recent call
> last):\r\n File
> \"/root/.ansible/tmp/ansible-tmp-1471850606.58-237797342898160/setup\",
> line 10, in ?\r\n import subprocess\r\nImportError: No module named
> subprocess\r\n", "msg": "MODULE FAILURE", "parsed": false}
>
>
> *4.x has python2.7 installed on it /usr/local/bin.*

Ansible expect Python to be at /usr/bin/python if it's not you need to
set ansible_python_interpreter.

https://docs.ansible.com/ansible/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine

--
Kai Stian Olstad

Jean-Yves LENHOF

unread,
Aug 22, 2016, 3:46:56 AM8/22/16
to ansible...@googlegroups.com
Verify that you have subprocess.py on your python2.7 installation...

You should also use ansible_python_interpreter in your inventory for this server (http://docs.ansible.com/ansible/faq.html, How do I handle python pathing not having a Python 2.X in /usr/bin/python on a remote machine?)


Regards,
Reply all
Reply to author
Forward
0 new messages