Network Automation Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

We created the following structure of directories and files to host our variables, as shown in the following diagram:

All files inside the group_vars directory contain the group variables for the groups that we have defined in our inventory and they apply to all the hosts within this group. As for the files within host_vars, they contain variables for each host. Using this structure, we can group variables from multiple hosts into a specific group file and variables that are host-specific will be placed in a separate file specific to this host.