First you conflate site as both a variable and a string, showing both
examples below to make the distinction clear.
You don't need key/keys() nor quotes if 'site' is a variable
when: site in sites
You seem to use site as both var and string, if site is a string, you
need quotes
when: "'site' in sites"
also you can do this
msg: "{{ sites.get(site)}}" if variable or msg: "{{
sites.get('site')}}" if string
Avoids error and shows 'none' if missing.
--
----------
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CACVha7ePCAQDeOH7TD6%2Bvfag8j-XHPkLnZFZ%2BOcgkYvRX76siw%40mail.gmail.com.