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