Hi Brian,

My verbiage is pretty poor when it comes to YAML - thanks for clarifying!

Since ansible_fqdn is automatically gathered I was referring to looking to 
see if that variable / fact was in a list. Your example worked perfectly! 
I'll make sure to try to look into the Jinja2 expressions a bit further in 
the future.

Thanks a ton!

On Friday, December 19, 2014 7:35:43 PM UTC-5, Brian Coca wrote:
>
> First, licensed_hosts is actually a list, not a dictionary, the dash 
> (-) signifies 'list item' 
>
> Second, you don't need to lookup ansible_fqdn as that should be part 
> of fact gathering which isnormally automatic, so this should "just 
> work": 
>
> tasks: 
>   - debug: msg="This should only run on test002.example.com" 
>     when: "{{ ansible_fqdn  in licensed_hosts}}" 
>
> -- 
> Brian Coca 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dc672fdb-98d2-4e4a-af62-01be01ed2748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to