Hi,
need to wait until a host is up and running. This host does not (yet) offer ssh, so I need a simple ping. The module wait_for only offers port tests, as far as I can see. Any ideas?
Michael Schwartzkopff
Hi,
need to wait until a host is up and running. This host does not (yet) offer ssh, so I need a simple ping. The module wait_for only offers port tests, as far as I can see. Any ideas?
Michael Schwartzkopff
You can use the until on a task
- command: ping -c1 <host>
register: r
until: r.rc == 0
You can also change retries and delay, check the documentation for details.
Thanks. cool
wait_for_connection is designed to wait until ssh is up and running and Ansible can actually run a module on it. No need for any until loops just ‘wait_for_connection:’.