hard failure or 'checkpoint' type task

I’m running a deployment playbook (stop, rollout, start, post-deploy tasks).

There are times when the whole playbook should abort if any tasks fail (e.g. not all hosts stop).

Is there an easy way to achieve this - what’s happening at the moment is the tasks fail on certain hosts and then the playbook continues using only the non-failed hosts.

I thought of two theoretical approaches - a global ‘fail-hard’ setting where any failure just stops the playbook, or a checkpoint task that only succeeds if all hosts are still in play. I’m sure other approaches are valid.

Is there anything that would solve this currently?

Thanks,
Will

There is already a new feature in 1.2 called “any_errors_fatal: True” (an attribute of the play)

I’m fine with there also being an action plugin capable of creating global failures, though currently “fail” will need to fail everything in a play (or a serial batch size) without the any_errors_fatal parameter set.

Awesome, any_errors_fatal sounds exactly what I need - I don’t think I need a failure level greater than play.

Thanks!