In this recipe, we will outline how to integrate Ansible and NetBox via the NetBox API. This integration is mandatory as it will allow us to populate the NetBox database through Ansible playbooks, as well as to use NetBox as our dynamic inventory source to create an Ansible inventory in later recipes.
Integrating NetBox with Ansible
Getting ready
NetBox should be installed as outlined in the previous recipe, and the IP needs to stretch between the Ansible control machine and the NetBox server. Ansible will communicate with NetBox over port 80, so this port needs to be open on the NetBox server.