Ansible dictionary lookup

May 06, 2016 · ANSIBLE VERSION ansible config file = configured module search path = Default w/o overrides CONFIGURATION. Nothing. OS / ENVIRONMENT. Running from and managing Linux. SUMMARY. When accessing a dictionary using {{ vars['dictname'] }} instead of {{ dictname }}, variable interpolation in the dictionary values doesn't work. STEPS TO REPRODUCE May 27, 2015 · Ansible evaluates lookups for a variable every time that variable is used in the task at the time the task is run. That means the lookup value could be different in different tasks. If you want to get a lookup value once and use the same value for every task in a play, you need to register a fact with the set_fact module instead. Aug 31, 2016 · atlante77 changed the title No substitution variable with dictionary key No Variable Substitution with dictionary key Sep 5, 2016 ansibot added triage affects_2.1 labels Sep 7, 2016 ansibot added the bug_report label Dec 13, 2016 I would be tempted to keep it as a dictionary, but just to render the INI file using the template module. That way additional lookup plugins can be avoided. You received this message because you are subscribed to the Google Groups "Ansible Project" group. What I've been trying to work through is what type of filter/query etc to lookup the key/value of the current ansible_fqdn and then loop through the task with the list items. E.G Only host 1 should have target 1 and target 2 as delegated.