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