# Ansible playbook hangs when target server does not have python

**URL:** <https://forum.ansible.com/t/ansible-playbook-hangs-when-target-server-does-not-have-python/33765>\
**Category:** Ansible Project\
**Created:** [September 8, 2020, 7:46pm UTC](https://forum.ansible.com/t/ansible-playbook-hangs-when-target-server-does-not-have-python/33765 "2020-09-08T19:46:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Easy\_King](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Easy\_King](https://forum.ansible.com/u/Easy_King)\
**Post date:** [September 8, 2020, 7:46pm UTC](https://forum.ansible.com/t/ansible-playbook-hangs-when-target-server-does-not-have-python/33765/1 "2020-09-08T19:46:41Z")

</div>

Ansible hangs when target host “10.9.88.205” does not have python installed.

I have successful ssh connectivity from ansible to target host shown below below:

ansible-host# ssh [root@10.9.88.205](mailto:root@10.9.88.205)

Below is my playbook:

- name: Play 2- Configure Source nodes

hosts: all

user: root

ignore\_errors: yes

gather\_facts: false

tasks:

- name: Get HTTPD userid on server

raw: id mwweb || id webadm || ls -ld /web

- name: Get OHS userid on server

raw: id mwweb

Below is how i run my playbook

$ ansible-playbook -i 10.9.88.205, -f 5 testpython.yml

PLAY [Play 2- Configure Source nodes] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Get HTTPD userid on server] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

It just hangs after printing TASK [Get HTTPD userid on server] and never completes.

This behavior is experienced with all IPs where python is not installed and is reachable through ssh.

Below is my ansible version.

ansible --version

ansible 2.9.4

config file = /etc/ansible/ansible.cfg

configured module search path = [u’/home/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]

ansible python module location = /usr/lib/python2.7/site-packages/ansible

executable location = /usr/bin/ansible

python version = 2.7.5 (default, Sep 26 2019, 13:23:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Can you please suggest how can i get ansible not to hang and proceed to the next task i.e Get OHS userid on server?
