Thanks for the replies guys.

The run_once concept seems interesting. Include with run_once, even without 
ping will make the included tasks to be ran one time only if the host is 
reachable.

What I thought (but not tested) is having 2 plays in a playbook. The first 
one checks which server is available and with set_fact defines its 
hostname. Then I can use this fact to declare the host on the second play.

I am still open to new suggestions so if anyone has a cleaner / better way, 
I would be glad to hear it.

Cheers.


-- 
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/4739b93b-2211-4430-9ce6-10b701fa3f8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to