Here is the issue:
I have a playbook:
tasks:
- include_vars: vhosts_vars.yml
- name: SSL vhost creation
template: src=templates/proxy_ssl_vhost.DOMAIN.j2 dest=/etc/httpd/vhosts.d/ssl_{{ item.servername }}.conf
with_items:
- "{{ proxy_apache_vhosts_dev }}"
and vars in vars/vhosts_vars.yml
proxy_apache_vhosts_dev:
- {servername: www.DOMAIN.com , machinename: domainsrv, documentroot: /var/www/html, vhost_ip: 1.2.3.4, vhost_name: DOMAIN.com.conf, serveradmin: "[email protected]" }
proxyPass:
- {dev: DOMAINdev , qual: DOMAINqual , prod: DOMAINprod}
Now, in my template, I also try to access the variables in ProxyPass, like: dev, qual or prod.
However, when I put this in my template:
{{ item.proxyPass.dev }}
It say that it's undefined... But, the other top variables are OK... I know that the items in proxy_apache_vhost_dev are "called" in the playbook via the "with_items:".... But How do I do to directly call the one in ProxyPass ?