# My playbook hangs during a task.

**URL:** <https://forum.ansible.com/t/my-playbook-hangs-during-a-task/32289>\
**Category:** Ansible Project\
**Created:** [February 20, 2020, 5:26pm UTC](https://forum.ansible.com/t/my-playbook-hangs-during-a-task/32289 "2020-02-20T17:26:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith\_Koene](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Keith\_Koene](https://forum.ansible.com/u/Keith_Koene)\
**Post date:** [February 20, 2020, 5:26pm UTC](https://forum.ansible.com/t/my-playbook-hangs-during-a-task/32289/1 "2020-02-20T17:26:35Z")

</div>

I have written a playbook that checks for accessible hosts, then copies a script to those hosts, runs the script, copies output to file and then looks for that file and copies it back to the local machine. I ran this playbook through a couple of linters and even ran it using the --syntax-check flag and everything checks out fine. When I run the playbook against a small list of hosts, it hangs on the task “Copy Files”. Not sure what the problem is and am hoping a fresh set of eyes on this will point out something I missed. I am running this on an Oracle Linux 7 server and the hosts are all Oracle Linux 7.

`

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [February 20, 2020, 7:52pm UTC](https://forum.ansible.com/t/my-playbook-hangs-during-a-task/32289/2 "2020-02-20T19:52:34Z")

</div>

> I have written a playbook that checks for accessible hosts, then copies a script to those hosts, runs the script, copies  
> output to file and then looks for that file and copies it back to the local machine. I ran this playbook through a  
> couple of linters and even ran it using the --syntax-check flag and everything checks out fine. When I run the playbook  
> against a small list of hosts, it hangs on the task "Copy Files". Not sure what the problem is and am hoping a fresh  
> set of eyes on this will point out something I missed. I am running this on an Oracle Linux 7 server and the hosts are  
> all Oracle Linux 7.

First step would be to verify whether the list of hosts in reachable group is accurate (use debug to get a list of the  
hosts in this group).

Second step would be to login into the host and find out what causes the hanging.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [February 25, 2020, 8:44am UTC](https://forum.ansible.com/t/my-playbook-hangs-during-a-task/32289/3 "2020-02-25T08:44:30Z")

</div>

We faced the same problem in our production. So if the node is slow//sluggish or goes unresponsive while playbook is running, Ansible will not leave the connection or in other words will keep waiting for output from the node(s). Well, in the case, playbooks seems to be hang.

Try to use async poll in the task:

[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_async.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html)
