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
--
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/2963f541-d537-4deb-95be-cda03867cb9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.