# Playbook hang when running reboot on 16 servers

**URL:** <https://forum.ansible.com/t/playbook-hang-when-running-reboot-on-16-servers/32768>\
**Category:** Ansible Project\
**Created:** [April 23, 2020, 11:14am UTC](https://forum.ansible.com/t/playbook-hang-when-running-reboot-on-16-servers/32768 "2020-04-23T11:14:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudu.c](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@dudu.c](https://forum.ansible.com/u/dudu.c)\
**Post date:** [April 23, 2020, 11:14am UTC](https://forum.ansible.com/t/playbook-hang-when-running-reboot-on-16-servers/32768/1 "2020-04-23T11:14:28Z")

</div>

Hi,

I have an ansible task that includes the reboot model.  
In my environment I have 16 servers, When I run the playbook it looks that all 16 servers were rebooted, but the playbook hang after the last reported server. I needed to use CTRL + C in order to release the shell

I did the same test with 8 servers and everything worked fine and the playbook was finished usefully.

Please note that i have both virtual and physical servers

**PlayBook**

### server reboot

- hosts:
- bare\_metal\_servers
- virtual\_servers

become: true  
gather\_facts: False  
tasks:

- name: Server reboot  
reboot:

- name: Verify that all hosts are reachable  
ping:

**Partial output:** In the output, I can see all my servers but the playbook hang on the last server

\<10.201.55.103\> (0, ‘’, ‘’)  
changed: [10.201.55.103] =\> {  
“changed”: true,  
“elapsed”: 260,  
“rebooted”: true  
}  
reboot: attempting to get system boot time  
\<10.201.55.18\> ESTABLISH SSH CONNECTION FOR USER: root  
\<10.201.55.18\> SSH: EXEC sshpass -d14 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/9c5302c865 -tt 10.201.55.18 ‘/bin/sh -c ‘"’“‘cat /proc/sys/kernel/random/boot\_id && sleep 0’”’“‘’  
\<10.201.55.18\> (0, ‘da1a1c32-ec20-43bc-b3d5-f2de90c2a5a1\r\n’, ‘Shared connection to 10.201.55.18 closed.\r\n’)  
reboot: attempting post-reboot test command  
\<10.201.55.18\> ESTABLISH SSH CONNECTION FOR USER: root  
\<10.201.55.18\> SSH: EXEC sshpass -d14 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/9c5302c865 -tt 10.201.55.18 '/bin/sh -c '”‘“‘whoami && sleep 0’”’“‘’  
\<10.201.55.18\> (0, ‘root\r\n’, ‘Shared connection to 10.201.55.18 closed.\r\n’)  
reboot: system successfully rebooted  
\<10.201.55.18\> ESTABLISH SSH CONNECTION FOR USER: root  
\<10.201.55.18\> SSH: EXEC sshpass -d14 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=“root”’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/9c5302c865 10.201.55.18 '/bin/sh -c '”‘“‘rm -f -r /root/.ansible/tmp/ansible-tmp-1587634092.84-210163948610261/ \> /dev/null 2\>&1 && sleep 0’”’"‘’  
\<10.201.55.18\> (0, ‘’, ‘’)  
changed: [10.201.55.18] =\> {  
“changed”: true,  
“elapsed”: 31,  
“rebooted”: true

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [April 23, 2020, 1:35pm UTC](https://forum.ansible.com/t/playbook-hang-when-running-reboot-on-16-servers/32768/2 "2020-04-23T13:35:26Z")

</div>

> all 16 servers were rebooted, but the playbook hang after the last reported  
> server. I needed to use CTRL + C in order to release the shell  
> [...]  
> &nbsp;&nbsp;&nbsp;&nbsp;- name: Server reboot  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reboot:  
> &nbsp;&nbsp;&nbsp;&nbsp;- name: Verify that all hosts are reachable  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ping:  
> [...]  
> \<10.201.55.18\> (0, 'root\r\n', 'Shared connection to 10.201.55.18  
> closed.\r\n')  
> reboot: system successfully rebooted  
> [...]  
> \<10.201.55.18\> (0, '', '')  
> changed: [10.201.55.18] =\> {  
> &nbsp;&nbsp;&nbsp;&nbsp;"changed": true,  
> &nbsp;&nbsp;&nbsp;&nbsp;"elapsed": 31,  
> &nbsp;&nbsp;&nbsp;&nbsp;"rebooted": true

It is not clear why the playbook hangs. The log shows the host rebooted. At  
this point you might want to proceed debugging and find out why the host does  
not respond to ping. Start with ssh to the host.

HTH,

&nbsp;&nbsp;-vlado

---

<div class="post-metadata">

**Author:** ![dudu.c](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@dudu.c](https://forum.ansible.com/u/dudu.c)\
**Post date:** [April 23, 2020, 3:54pm UTC](https://forum.ansible.com/t/playbook-hang-when-running-reboot-on-16-servers/32768/3 "2020-04-23T15:54:57Z")

</div>

All is working … I cam SSH everything - The task was finished successfully but hang in the end.  
In order to kill it i used CTRL +C

And again - it was working with 8 servers

 ![WhatsApp Image 2020-04-23 at 17.28.56.jpeg](https://us1.discourse-cdn.com/ansible/original/2X/b/bab8525b1d3e8ddd30be0d4cd537d6cc1792ab03.jpeg)
