Acting on failure

Hi,

I’m pretty new to Ansible, but so far really like it. I am trying to write a continous deployment playbook, and so far it’s pretty need. One thing I haven’t been able to figure out is how to react to a task failure. I don’t wan’t to ignore the failure, and I’m fine with the play stopping, but I would like to be able to write a file upon failure, something a la

when: fail command echo “error1” > /tmp/error

Is there a way to this. Catch the failure and react to it.

/Steen

You can use “register” along with “ignore_errors” right now.

You would ignore the error and still be able to use the “when” statement in a later task to react to it.

Hope this helps!