How to do it...

  1. Update the group_vars/all.yml file with the devices information, as follows:
$ cat group_vars/all.yml  < --- Output Omitted for brevity --- > devices:  - role: Leaf_Switch    type: 7020SR    vendor: Arista    color: 'f44336'  # red  - role: Spine_Switch    type: 7050CX3    ru: 2    vendor: Arista    color: '2196f3'  # blue
  1. Create the group_vars/leaf.yml and group_vars/spine.yml files, then update them with the following information:
$ cat group_vars/leaf.yml  ---device_model: 7020SRdevice_role: Leaf_Switchvendor: Arista$ cat group_vars/spine.yml---device_model: 7050CX3device_role: Spine_Switchvendor: Arista
  1. Create a new task to create the manufacturer for all of the devices in our inventory under the tasks/create_device_vendors.yml file, as shown ...

Get Network Automation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.