- wait_for:
host: "{{ item }}"
port: 22
state: started # Port should be open
delay: 0 # No wait before first check (sec)
timeout: 2 # Stop checking after timeout (sec)
ignore_errors: yes
register: netstatoutput
delegate_to: localhost
with_items: "{{ groups['all_hosts'] }}"
- debug:
msg: "{{ netstatoutput }}"
"msg": "Timeout when waiting for 10.9.172.62:22"
"msg": "Timeout when waiting for 10.9.72.66:22"
"msg": "Timeout when waiting for 10.9.172.42:22"
....