Building the Ansible inventory
One of Ansible’s two fundamental building blocks is the inventory. It defines the nodes in scope, their attributes, connection types, variables, and more. Ansible also supports both static and dynamic inventories. In this book, we use the static inventory in all but Chapter 12, where a dynamic inventory integration is explained.
You will learn how to create a static inventory in two formats: the INI format and the YAML format. Let’s take a look at how to build an INI-style inventory file specifically for our lab topology.
The inventory file supports organization into groups to simplify how to target different components of the infrastructure. In our lab, we have four types of devices: Linux servers, Arista cEOS, SR Linux, and Juniper cRPD network devices. Thus, we group them accordingly. In the following inventory file, you will create node definitions and group them based on the types of devices:
root@cookbook-lab:~/cookbook...