# timout-playbook for ubuntu after reboot

**URL:** <https://forum.ansible.com/t/timout-playbook-for-ubuntu-after-reboot/32224>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 13, 2020, 8:55pm UTC](https://forum.ansible.com/t/timout-playbook-for-ubuntu-after-reboot/32224 "2020-02-13T20:55:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [February 13, 2020, 8:55pm UTC](https://forum.ansible.com/t/timout-playbook-for-ubuntu-after-reboot/32224/1 "2020-02-13T20:55:01Z")

</div>

**Hi, can someone please explain why my playbook for instance timeout after a reboot:**

/dev/null 2\>&1 && sleep 0’  
The full traceback is:  
WARNING: The below traceback may _not_ be related to the actual failure.  
File “/tmp/ansible\_wait\_for\_payload\_NqkPb5/ansible\_wait\_for\_payload.zip/ansible/modules/utilities/logic/wait\_for.py”, line 599, in main  
File “/tmp/ansible\_wait\_for\_payload\_NqkPb5/ansible\_wait\_for\_payload.zip/ansible/modules/utilities/logic/wait\_for.py”, line 456, in \_create\_connection  
File “/usr/lib/python2.7/socket.py”, line 557, in create\_connection  
for res in getaddrinfo(host, port, 0, SOCK\_STREAM):

fatal: [10.0.2.236 → localhost]: FAILED! =\> {  
“changed”: false,  
“elapsed”: 600,  
“invocation”: {  
“module\_args”: {  
“active\_connection\_states”: [  
“ESTABLISHED”,  
“FIN\_WAIT1”,  
“FIN\_WAIT2”,  
“SYN\_RECV”,  
“SYN\_SENT”,  
“TIME\_WAIT”  
],  
“connect\_timeout”: 5,  
“delay”: 5,  
“exclude\_hosts”: null,  
“host”: “ubuntu”,  
“msg”: null,  
“path”: null,  
“port”: 22,  
“search\_regex”: null,  
“sleep”: 1,  
“state”: “started”,  
“timeout”: 600  
}  
},  
“msg”: “Timeout when waiting for ubuntu:22”  
}

playbook :

- name: reboot node  
shell: sleep 2 && shutdown -r now “Reboot triggered by ansible”  
async: 1  
poll: 0  
ignore\_errors: true

# poll ssh port until we get a tcp connect

- name: wait for node to finish booting  
become: false  
local\_action: wait\_for host=ubuntu  
port=22  
state=started  
delay=5  
timeout=600  
**--------------(timeout after this)--------------FYI: instance was rebooted within 60 secs**

# give sshd time to start fully

- name: wait for ssh to start fully  
pause:  
seconds: 15

# wait a few minutes between hosts, unless we’re on the last

- name: waiting between hosts  
pause:  
minutes: 10  
when: inventory\_hostname != ansible\_play\_hosts[-1]

**Please explain thanks**

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 14, 2020, 5:22pm UTC](https://forum.ansible.com/t/timout-playbook-for-ubuntu-after-reboot/32224/2 "2020-02-14T17:22:41Z")

</div>

Hi

The reboot module was created to avoid manual fiddling with shell cruft like you do now. So what’s the reason you are not using the reboot module?  
If possible please reply to this thread and don’t start yet another one.

Thx!

---

<div class="post-metadata">

**Author:** ![Work\_Email](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@Work\_Email](https://forum.ansible.com/u/Work_Email)\
**Post date:** [February 14, 2020, 6:28pm UTC](https://forum.ansible.com/t/timout-playbook-for-ubuntu-after-reboot/32224/3 "2020-02-14T18:28:52Z")

</div>

thanks dick for replying. I was able to figure it out the issue. I had to “register” to keep it going.
