Hi,

On 06.08.19 05:29, Mohtashim S wrote:
> So, if I understand you correctly there is no feature to abort the entire 
> playbook run incase of a single error encountered?

There is afaik no feature immediatly aborting the current task for all
hosts, when an error is encountered on a single host. any_errors_fatal
will, as I said and the docs say, stop any further tasks from being
executed on any host.

The way Ansible works here, is for each task:

Send a python script and the data specified to the remote node and
execute it there. The data contains your full loop, it's not transferred
for each item of the loop.

That's done in parallel for X hosts. So Ansible has no reliable way to
stop a task that is already running.

As you can see from my example, in the first playbook, the second task
is not executed for any host, because host abc fails the first task.

If you want your loop to skip all remaining items on that task on that
host once an error has occured you can use my second example. If you add
any_errors_fatal all hosts won't execute any other tasks.

Sebastian

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: [email protected]

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis ----
------------------------ https://openstack-tage.de (Code DOST-B1) ----

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/64073185-9c7a-28df-f66a-9a5e9d16af7a%40b1-systems.de.

Reply via email to