I'm sorry if this has come up before - I couldn't find any answers directly 
related to my question.

I'm trying to use set_fact to set an array and use that in a for loop 
inside a template file.
In my playbook I have: 
set_fact: av_name="['av1', 'av2', 'av3']"

And in my template file I'm testing with:
{% for item in av_name %}
"this": "{{ item }}"
{% endfor %}

Here's my templated file - jinja2 doesn't seem to understand the array:
"this": "["
"this": "'"
"this": "a"
"this": "v"
"this": "1"
"this": "'"
"this": ","
"this": " "
"this": "'"
"this": "a"
"this": "v"
"this": "2"
"this": "'"
"this": ","
"this": " "
"this": "'"
"this": "a"
"this": "v"
"this": "3"
"this": "'"
"this": "]"

Hopefully I'm doing something wrong!


-- 
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/5e4f052d-1995-4019-a249-0e86b10339d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to