# Updated ansible failed on checks

**URL:** <https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666>\
**Category:** Ansible Project\
**Created:** [November 14, 2019, 10:53pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666 "2019-11-14T22:53:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Bidwell](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Post date:** [November 14, 2019, 10:53pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/1 "2019-11-14T22:53:56Z")

</div>

Hi all,

After running ansible 2.9, I’m getting these errors:

fatal: [jjohnson-lx]: FAILED! =\> {“msg”: “The conditional check ‘ansible\_distribution\_major\_version | version\_compare(‘6’, ‘=’)’ failed. The error was: template error while templating string: no filter named ‘version\_compare’. String: {% if ansible\_distribution\_major\_version | version\_compare(‘6’, ‘=’) %} True {% else %} False {% endif %}\n\nThe error appears to be in ‘/zabbix.yml’: line 76, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: "install 6 if not exists (no proxy)"\n ^ here\n”}

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [November 14, 2019, 10:58pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/2 "2019-11-14T22:58:01Z")

</div>

The syntax you are using was deprecated in Ansible 2.5 and should have been emitting a deprecation warning. See this doc for more info:

[https://docs.ansible.com/ansible/latest/porting\_guides/porting\_guide\_2.5.html#jinja-tests-used-as-filters](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#jinja-tests-used-as-filters)

Effectively you need to change the `|` to `is`

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [November 15, 2019, 7:45am UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/3 "2019-11-15T07:45:20Z")

</div>

In addition to changing the deprecated syntax use "version" instead of  
"version\_compare"  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_tests.html#version-comparison](https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#version-comparison)

(Just curious). It's not clear why 2.9 complains "no filter named  
'version\_compare'". Both names of the filter are present in 2.9 source  
[https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/plugins/test/core.py](https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/plugins/test/core.py)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# version comparison  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'version\_compare': version\_compare,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'version': version\_compare,

(lines 199-201)

, and I can't find any explanation in the "porting guides" and "release notes"  
either.  
[https://docs.ansible.com/ansible/latest/reference\_appendices/release\_and\_maintenance.html](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html)  
[https://docs.ansible.com/ansible/latest/porting\_guides/](https://docs.ansible.com/ansible/latest/porting_guides/)

What am I missing ?

Thank you,

&nbsp;&nbsp;-vlado

---

<div class="post-metadata">

**Author:** ![sdoran](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sdoran](https://forum.ansible.com/u/sdoran)\
**Post date:** [November 15, 2019, 4:28pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/4 "2019-11-15T16:28:44Z")

</div>

Vlado,

You're not missing anything. The version\_compare test still exists, is not deprecated, and is fine to use — just not as a filter.

We used to register tests as filters. Since we no longer do this, Jinja raises an error that version\_compare is not a valid filter, which is accurate.

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [November 15, 2019, 6:56pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/5 "2019-11-15T18:56:38Z")

</div>

Sam,

thank you very much for the clarification!

For the record, quoting from \*Ansible 2.9 "Immigrant Song" Release Notes\*  
[https://github.com/ansible/ansible/blob/stable-2.9/changelogs/CHANGELOG-v2.9.rst#id2](https://github.com/ansible/ansible/blob/stable-2.9/changelogs/CHANGELOG-v2.9.rst#id2)

&nbsp;&nbsp;\* Jinja tests - Remove deprecated functionality of registering tests as  
&nbsp;&nbsp;&nbsp;&nbsp;filters ([https://github.com/ansible/ansible/issues/55319](https://github.com/ansible/ansible/issues/55319))

(This explains the error in 2.9: "no filter named 'version\_compare'")

&nbsp;&nbsp;-vlado

---

<div class="post-metadata">

**Author:** ![Chris\_Bidwell](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@Chris\_Bidwell](https://forum.ansible.com/u/Chris_Bidwell)\
**Post date:** [November 15, 2019, 7:37pm UTC](https://forum.ansible.com/t/updated-ansible-failed-on-checks/31666/6 "2019-11-15T19:37:16Z")

</div>

Thanks all!
