This project was inspired by my lengthy search for a reliable way to integrate Netbox's dynamic inventory into Semaphore. Throughout my research, I found many suggested methods to be either overly complex or unstable. Finally, I discovered a simple and effective use of the netbox.netbox.nb_inventory plugin built into Ansible, which greatly simplified the process.
This repository demonstrates the use of the netbox.netbox.nb_inventory plugin to create a dynamic inventory in Semaphore. It enables automatic synchronization of data from Netbox, simplifying the management of your infrastructure and the execution of Ansible playbooks.
- Access to Semaphore
- Access to Netbox with configured API
Ensure your Netbox is configured and accessible for API interaction. Obtain an API token which will be used to authenticate requests.
-
In Semaphore, go to the inventory section.
-
Create a new inventory.
-
Enter the following settings for the plugin configuration:
plugin: netbox.netbox.nb_inventory api_endpoint: http://your_netbox_url_here token: YOUR_NETBOX_API_TOKEN validate_certs: False config_context: False
Replace
http://your_netbox_url_hereandYOUR_NETBOX_API_TOKENwith the actual data from your Netbox.
Once configured, you can run Ansible playbooks in Semaphore using the dynamic inventory which automatically updates host data from your Netbox.
Learn more about the netbox.netbox.nb_inventory plugin and its capabilities in the official Ansible documentation.