global role hooks

I have role, I run playbook. It finished successfully, and I want to make some post-role action (like set some flags in other system, put file or etc). In this case the behavior is predictable (I have task in playbook).
But when play failed, it is harder. I want to do some actions in that case and notify people.

What about adding directory in role tree structure for “success”-hook and “failure”-hook? And some forward thought: failure-hook with access to failed task information would be super cool.

Right now the best you have is to key off the /usr/bin/ansible-playbook return code like so:

/usr/bin/ansible-playbook foo.yml || something_else.sh