On Wednesday, December 20, 2017 at 12:14:50 PM UTC+1, Jordan Borean wrote: > > delegate_to is a tricky one and I've come across a few pitfalls. One thing > to note is that delegate_to is meant to replace the connection vars for the > host specified, in this case I would have expected ansible_host to be > localhost in every instance. >
It would still be nice to have a way to access the "original value" of ansible_host then. And the behavior when setting ansible_host from the inventory is still questionable. This is what https://github.com/ansible/ansible/issues/30630 is about. > What I would suggest is infinitely easier which is to use the > wait_for_connection task like so; > > - name: wait for connection to come online > wait_for_connection: > delay: 30 > timeout: 300 > check_mode: False > > > The wait_for_connection plugin > http://docs.ansible.com/ansible/latest/wait_for_connection_module.html > was adding in Ansible 2.3 and is designed to get Ansible to continue to try > and connect to the current host and run the ping module and wait until it > succeeds. It's better than wait_for as it not only checks if the port is > online but also that Ansible can connect to the host before continuing. > Thanks for the tip. I didn't know about wait_for_connection. This is definitely a better match for my particular case. Regards; Gaudenz -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5a2918ac-a92e-4d66-8ca1-e3d6737ce263%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
