Conditional check not working since upgrading to v.2.0.0.2

242 views
Skip to first unread message

Edd Grant

unread,
Jan 21, 2016, 6:40:31 AM1/21/16
to Ansible Project
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

Brian Coca

unread,
Jan 21, 2016, 8:58:17 AM1/21/16
to Ansible Project
are you gathering facts?


--
Brian Coca

Edd Grant

unread,
Jan 21, 2016, 11:17:09 AM1/21/16
to ansible...@googlegroups.com
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


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/Q77oywKZ_kM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3DoZ4DweyqzQpupTD6grOzMGWFdVBQkMrU1BbO7zvizLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

Brian Coca

unread,
Jan 21, 2016, 11:42:03 AM1/21/16
to Ansible Project
no, facts should be gathered as normal, can you put in the following
task before the problem?

- debug: var=hostvars[inventory_hostname]
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAO5arLO_S%3DD-oXKvjkXoTOBRLzG1mxjU4UuvhNtD5J%3DZeU%3D_Lw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages