I have a dictionary of vars in an Ansible role ( in roles/my_role/vars/main.yml ):
my_vars:
- name: var1
string: var1_string
- name: var1
string: var1_string
I want to include all of these in a single file constructed with a jinja2 templates loop:
{% for v in my_vars %}
"{{ v.string }}"
{% endfor %}
Will this work? Can the J2 templating engine refer to vars in roles/my_role/vars/main.yml in this way? Or is it limited to globals vars and vars specific to the play the initiates the templating engine?