On 06. juli 2017 21:54, Listing wrote:
HI al,

I am running a playbook on a set of hosts of which I expect them to be
offline. I want to check every 10 seconds whether they are online or not
and then output a message when all is running, or another message when all
is not running after 10 retries for instance.

I am getting 'host unreachable' after which the unreachable host is being
removed. I can continue to run other tasks on the hosts that were online
(by using 'meta: clear_host_errors'), but I can't retry the task on the
host that was not online.

Does anybody know how to keep trying (for instance 10 times) a task until
all hosts have been successful? Is this possible?

Have you check out wait_for?
https://docs.ansible.com/ansible/wait_for_module.html

and with "any_errors_fatal: true" you can at least stop the play if one or more host doesn't come online.

--
Kai Stian Olstad

--
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/392bfce4-0b1b-0aab-b238-e9aab4289f3c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to