ansible/ansible — pull request #1811 by fdavis (2013-01-01 01:56:01+00:00)
Title: add when_{failed,changed}, and extended when_{set,unset}

This commit extends the 'when_' conditions to failed and changed
json results

Since I've seen the following suggested solutions a few time in the mailing list:

only_if: is_failed($res)
only_if: $res.changed == True

They might not occur a lot, but I think the when_ syntax makes them more readable and much easier to remember.

Additionally it makes when_*'s behave more alike in that they all except
{and,or,not} logic, as opposed to only when_{int,str,flt,bool} accepting additional logic.

My test playbooks for these features can be [found here] [1].
[1]: https://github.com/fdavis/ansible-when-playbooks