In this recipe, we will outline how to use NetBox as a dynamic inventory source. With this approach, NetBox will have the inventory for our network infrastructure and we will use the different groupings available (such as sites, device roles, and so on) to build a dynamic inventory for Ansible and group them according to NetBox.
Using NetBox as a dynamic inventory source for Ansible
Getting ready
Integration between NetBox and Ansible needs to be in place, as outlined in the previous recipes.
How to do it...
- In your main directory, create a new folder called netbox_dynamic_inventory...