Hi,

New to Ansible and probably not using it the way most are.  I'm a network 
engineer and am trying to use it to generate config files using the 
template module.  It's working well for one file but I'd like to extend it 
to support multiple "hosts" that use different variables.

In my hosts file, I only have localhost defined (since I'm just writing 
data to files).  I have a role "switch" that includes one task using 
with_items set to "hostname: item1" etc.  I am wondering if you can specify 
a vars_files for each of the "items"?  I tried to set vars_files in the 
playbook site.yml to "vars/roles/switch/vars/{{item.hostname}}.yml" but 
that doesn't work.  I think I could "trick" Ansible by defining multiple 
hosts to resolve to 127.0.0.1 in the hosts file but would rather avoid 
that.  Any suggestions?  

-- 
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/f7e749ae-baa0-4f6f-a495-4bfdba29b1c6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to