wait_for_connection with 2.2 and/or wait_for with a bastion host?

267 views
Skip to first unread message

Michael Artz

unread,
Apr 17, 2017, 4:21:07 PM4/17/17
to Ansible Project
I'm attempting to reboot a Linux host and wait for it to become available again.  I've followed the ideas in both the docs (https://docs.ansible.com/ansible/wait_for_module.html) and https://github.com/ansible/ansible/issues/14413 and it "works", however my situation is slightly different, as I have a bastion/relay host between me and the remote host (in a private OpenStack cloud).  So my wait_for ends up waiting the entire delay+timeout (15+60 seconds) time (and then succeeding, for some reason), despite the fact that the machine rebooted in <15 seconds.

For a variety of reasons, I'm stuck using the "official" RPMs out of EPEL, which are currently at Ansible 2.2.1, but I just noticed that there is a "wait_for_connection" module in 2.3 that sounds like exactly what I need.  Is there any way to emulate this functionality with "wait_for" given that I've got a non-routable node and have to go through a bastion host?

Thanks,
-Mike

Matt Martz

unread,
Apr 17, 2017, 4:39:00 PM4/17/17
to ansible...@googlegroups.com
Ansible 2.3 is in EPEL testing.

However, to use `wait_for` you should also use `delegate_to` and delegate the execution of the task to the bastion, so that `wait_for` is running from the bastion.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2847b564-181d-463d-89b1-0381ece8f842%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages