Hello Everyone,

I am trying to iterate over a dictionary in a Jinja2 template (in Ansible). 
One of the arrays or keys in the dictionary is 'abcd'
This works fine, but key 'abcd' varies in each dictionary.
{{ item.value.abcd.port }}


I am looking to do something like below using a variable 'nginx_dir'.
{% set nginx_dir = item.value.keys().1 %}
{% set my_port = item.value.nginx_dir.port %}

Regards,
Vikas

-- 
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/f94bb2bd-cb2a-4eec-8420-2ff5408de9f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to