1.2 to 1.3 when_failed error

Hi all, There are a few posts going around on this but I’m a wee bit stick

The following example worked on 1.2

After a 1.3 upgrade it throughs the following.

fatal: [rtui-01] => Conditional expression must evaluate to True or False: is_failed($result)

I attempted to replace with when: $result == 0. Received a sad panda with that too. Any clue what I’m doing wrong?

Instead of "when_failed: $result" you can do something like "when:
result>failed"

see http://www.ansibleworks.com/docs/playbooks_conditionals.html#id10

-John

Yep, when_failed has been deprecated for some time, and this is why it is also not documented.

I suspect you are referencing an old non-AnsibleWorks tutorial or web page post.

1.4 adds lots of deprecation warnings for things like this.

Thanks guys, I was lazy and did not go through the docs again :frowning:

We’ve managed our platform at MediaCrossing via ansible from day one. Good show to you!