In this recipe, we will outline how to collect the operational state from network devices using the NAPALM fact-gathering Ansible module. This can be used to validate the network state across multi-vendor equipment since NAPALM Ansible's fact-gathering module returns a consistent data structure across all vendor OSes supported by NAPALM.
Collecting device facts with NAPALM
Getting ready
To follow along with this recipe, it is assumed that an Ansible inventory is already in place and network reachability between the Ansible controller and the network is already established. Finally, the network is configured as per the previous recipe.