In this recipe, we will outline how to build and structure our Ansible inventory to describe our sample service provider network setup outlined in this chapter. Building an Ansible inventory is a mandatory step, in order to tell Ansible how to connect to the managed devices. In the case of NAPALM, we need to sort the different nodes in our network into the correct vendor types supported by NAPALM.
Building an Ansible network inventory
How to do it...
- Inside the new folder (ch6_napalm), we create a hosts file with the following content:
$ cat hosts
[pe]
mxpe01 ansible_host=172.20.1.3
mxpe02 ansible_host=172.20.1.4
xrpe03 ansible_host=172.20.1.5
[p]
mxp01 ansible_host=172.20.1.2
mxp02 ansible_host=172.20.1.6
[junos]
mxpe01
mxpe02...