# Conditional check not working since upgrading to v.2.0.0.2

**URL:** <https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303>\
**Category:** Ansible Project\
**Created:** [January 21, 2016, 11:40am UTC](https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303 "2016-01-21T11:40:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edd\_Grant](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@Edd\_Grant](https://forum.ansible.com/u/Edd_Grant)\
**Post date:** [January 21, 2016, 11:40am UTC](https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303/1 "2016-01-21T11:40:31Z")

</div>

Hi all,

Since upgrading to Ansible 2.0.0.2 the following code has stopped working:

- include: redhat-hosts.yml  
when: ansible\_os\_family == ‘RedHat’

This results in the error:

ERROR! The conditional check ‘ansible\_os\_family == ‘RedHat’’ failed. The error was: ERROR! error while evaluating conditional (ansible\_os\_family == ‘RedHat’): ERROR! ‘ansible\_os\_family’ is undefined

This worked fine in 1.9.x - I can’t find anything in the docs to suggest why this would stop working with the upgrade to v2.x. I did wonder if the name of the fact had changed in v2.x but a quick run of the setup module confirms that the fact is present. I am using the default fact gathering configuration and am not using fact caching.

Anyone have any ideas?

Cheers,

Edd

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 21, 2016, 1:58pm UTC](https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303/2 "2016-01-21T13:58:12Z")

</div>

are you gathering facts?

---

<div class="post-metadata">

**Author:** ![Edd\_Grant](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@Edd\_Grant](https://forum.ansible.com/u/Edd_Grant)\
**Post date:** [January 21, 2016, 4:16pm UTC](https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303/3 "2016-01-21T16:16:42Z")

</div>

Hi Brian,

I was gathering facts when using Ansible 1.9.x and have done nothing to disable it since upgrading to 2.x. (Unless 2.x disables it by default and I’ve not noticed that in the docs?)

Cheers,

Edd

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 21, 2016, 4:41pm UTC](https://forum.ansible.com/t/conditional-check-not-working-since-upgrading-to-v-2-0-0-2/20303/4 "2016-01-21T16:41:59Z")

</div>

no, facts should be gathered as normal, can you put in the following  
task before the problem?

- debug: var=hostvars[inventory\_hostname]
