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/CAJ5XC8%3DZG864Ur29SMpvOhE%2B1XtESv19kryiVdQskDxE_Fz3BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.