On 10. nov. 2016 15:20, Dader Grund wrote:
i have defined following variables in my playbook:
-
vars:
ip:
fw1: 0.0.0.1
fw2: 0.0.0.2
-
temple.j2 contains :
{% for addr in ip %} {{ addr }} {% endfor %}
# this returns the name of the fields : fw1 fw2
what should i edit in the for loop inoder to return the values of the
fields ? namely 0.0.0.1 0.0.0.2
{% for key, value in ip.iteritems() %} {{ value }} {% endfor %}
To read more about it
http://jinja.pocoo.org/docs/dev/templates/#for
--
Kai Stian Olstad
--
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/336ceaed-f7a4-1868-3c79-dcc583c43564%40olstad.com.
For more options, visit https://groups.google.com/d/optout.