Hi,
I have a playbook like:
---
...
vars_files:
- vars/stage-{{stage}}.yml
- vars/extint/stage-{{stage}}.yml
roles:
- { role: extint, params: "{{ extint_instance }}" }
...
Inside the role "extint" I have this task, processing a template in a loop
...
- name: create generate {{env_name}}/env.properties
template: src=./env.properties.j2 dest=/path/to/config_generated/system/{{env_name}}{{ item.index }}/env.properties
with_items: params
tags: generate_resources
...
Now my problem is that all (global) variables that are read from the playbook ( -vars/extint/stage-{{stage}}.yml ) are not accessible in the template.
How can I loop over a list of items, process a template for each item - and access common variables in the template ? Do I need to pass the ansible_managed variables explicitely to the template somehow ?
Thanx, Torsten