cleanup action

Is there a way to execute a cleanup action on a host, if any rule in a playbook fails?

Kind of like an except clause in programming languages?

You can ignore_errors: True / register: result on the first action and
have two following tasks, one if it succeeds and one if it fails.

when_integer: ${command.rc} > 0

when_integer: ${command.rc} == 0

etc