Thank you very much! No wonder I hadn't figured this out earlier! I'm
sure there's just some aspect I never looked into. Just for the next
person who comes along what I got to work was
playbook.yml
---
- hosts: localhost
become: false
tasks:
- include: "roles/httpd/tasks/main.yml"
with_fileglob:
- vars/*.yml
roles/httpd/tasks/main.yml:
---
- include_vars: "{{ item }}"
- debug: msg="{{ site_name }}"
vars/site1.yml:
---
site_name: "site1"
http_port: 8888
vars/site2.yml:
---
site_name: "site2"
http_port: 8899
ansible-playbook playbook.xml does give the output I needed (snippet):
ok: [localhost] => {
"msg": "site1"
}
ok: [localhost] => {
"msg": "site2"
}
On Wednesday, October 19, 2016 at 12:51:48 PM UTC-5, Brian Coca wrote:
>
> - include: file.yml
> with_fileglob:
> - vars/*.yml
>
>
> file.yml
>
> - include_vars: {{ item }}
> - debug: msg="{{ field1 }} from with list"
> - debug: msg="{{ field2 }} from with list"
> - template: src="templates/site.conf.j2" dest="site.conf"
>
>
> ----------
> Brian Coca
>
--
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/2761b49d-f0cb-485f-9ab2-fd428ce2a2c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.