I’m working on modeling our datacenter top-of-rack switches in Ansible, and have run into a potential problem with my approach. The basic idea is to use a hierarchal group structure that starts with general purpose (tor), and then get more specific for each deployment based on application that rack is supporting:
`
[tors]
[app1switches]
app1switch1
app1switch2
[app2switches]
app2switch1
app2switch2
[tors:children]
app1switches
app2switches
`
I want to abstract all my VLAN configuration into group-defined variables. In this example, let’s say that there is at least one VLAN that is standard across all TORs, and then each application has their own unique set of VLANs that also need to be applied. My idea was to create group variable files such as:
`