Breaking a loop

Hello,

I have a loop that loops over a result from program execution. On every iteration a shell command is executed. However, it may happen that one of these shell commands fails. Is possible to prevent continuing the loop if this happens? From what I can see, other iterations are executed even though one of them failed.

Thanks.

That’s odd, the task should fail unless you’re specifying other failed_when conditions or retries. Could you share an example of the task you’re executing?

​No, the task as a whole will fail ​if one of the iterations fails, but
even if one iteration fails, the other iterations in that same task still
get executed.

I don't think failed_when will impact on iterations, only the task as a
whole.

  Serge

Serge is correct in the above.

The registration of a loop variable results in a list being stored.