Let's say I have two groups of devices to configure, eos-group and 
junos-group.

Let's focus on junos-group. 
I have 10 devices in the junos-group. 
Each device will be configured with a mgmt ip, hostname, interface, routes 
...etc

Inside of  /etc/ansible/host_vars/, I could create different files for each 
host: hostname1.yaml, hostname2.yaml ....
However, this doesn't. scale, does it? 

Can I just create one file (lets call it all_junos_hosts.yaml) inside 
/etc/ansible/host_vars/, and inside of t his single file, I'll use 
hierarchical structure to define variables for different hosts?
E.g: my *all_junos_hosts.yaml* file will look like this:

10.10.10.10:
  hostname: hostname1
  data_nexthop: 10.10.10.1
  interfaces:
    mgmt_interface:
      name: em0
      ip: 10.10.10.10:
12.12.12.12:
  hostname: hostname2
  data_nexthop: 12.12.12.1
  interfaces:
    mgmt_interface:
      name: em0
      ip: 12.12.12.12

I read somewhere that if I create a file called all_junos_hosts.yaml inside 
of /etc/ansible/host_vars/, ansible will think there is a host called 
all_junos_hosts.yaml. 
How do I get around this?

Basically all I want to do is, in my template, I'll do something like *set 
interfaces management "{{ reference for mgmt interface for this host }}*" 
... etc

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/853a412c-2b95-4e99-94bf-3da30badb559%40googlegroups.com.

Reply via email to