Hello All,
I have two tasks and few yaml files. This is obviously not working as all
the files (/etc/nginx/myconfigs/{ab01a,ab01b,ab,www}) have variables from
*'**www.**yml',* which is the last item in the iteration.
- include_vars: site_{{ item }}.yml
with_items: site_files
- name: Create nginx files in /etc/nginx/myconfigs
template: src=nginx_site.d_conf.j2 dest=/etc/nginx/myconfigs/{{ item }}.
conf
with_items: site_files
These are the items in *'site_files' *variable*.*
site_files:
- ab01a
- ab01b
- ab
- www
These are the yaml files in which I have few variables which I am
substituting in the jinja2 template file (nginx_site.d_conf.j2).
ab01a.yml
ab01b.yml
ab.yml
www.yml
Please help me to tackle this. I am looking out for a way to dynamically
include variables from Yaml files and substitute those in template action.
I can do this by including one variable file and a template action at a
time, but I am sure there would be a better way to handle this.
Regards,
Vikas
--
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/37faca5b-be54-4719-8788-739123fa4318%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.