# 1.2 to 1.3 when\_failed error

**URL:** <https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747>\
**Category:** Ansible Project\
**Created:** [October 22, 2013, 10:47pm UTC](https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747 "2013-10-22T22:47:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil\_Siegrist](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Phil\_Siegrist](https://forum.ansible.com/u/Phil_Siegrist)\
**Post date:** [October 22, 2013, 10:47pm UTC](https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747/1 "2013-10-22T22:47:54Z")

</div>

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

- name: “check for gelf download”  
shell: /usr/bin/test -f /opt/mx/bin/logback-gelf-0.9.6p2-jar-with-dependencies.jar  
register: result  
ignore\_errors: true

- name: “download gelf”  
shell: cd /opt/mx/bin && wget [http://111.111.111.111/files/logback-gelf-0.9.6p2-jar-with-dependencies.jar](http://111.111.111.111/files/logback-gelf-0.9.6p2-jar-with-dependencies.jar)  
when\_failed: $result

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?

---

<div class="post-metadata">

**Author:** ![John\_Jarvis](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@John\_Jarvis](https://forum.ansible.com/u/John_Jarvis)\
**Post date:** [October 23, 2013, 12:58pm UTC](https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747/2 "2013-10-23T12:58:25Z")

</div>

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

see [http://www.ansibleworks.com/docs/playbooks\_conditionals.html#id10](http://www.ansibleworks.com/docs/playbooks_conditionals.html#id10)

-John

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 23, 2013, 6:45pm UTC](https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747/3 "2013-10-23T18:45:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Phil\_Siegrist](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Phil\_Siegrist](https://forum.ansible.com/u/Phil_Siegrist)\
**Post date:** [October 24, 2013, 3:02pm UTC](https://forum.ansible.com/t/1-2-to-1-3-when-failed-error/13747/4 "2013-10-24T15:02:09Z")

</div>

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

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