Combining Netbox and Ansible
from wasabi@feddit.org to selfhosted@lemmy.world on 24 Mar 22:05
https://feddit.org/post/9712314
from wasabi@feddit.org to selfhosted@lemmy.world on 24 Mar 22:05
https://feddit.org/post/9712314
I’m new to netbox and as far as I can tell there are two ways to combine Netbox with ansible.
- Automate network and Netbox with ansible. A playbook would configure a switch port and then use the Netbox ansible collection to modify Netbox to reflect the change. All changes go through Ansible.
- Use Netbox as the data source for ansible. A playbook pulls the switch configuration from Netbox and applies it to the switch using ansible. All changes go through Netbox.
What would be preferred? Both solve the Problem of having to change everything twice.
threaded - newest
The latter. Ansible isn’t for storing configs, it’s for applying them.
Go with the second option.
Having Netbox as your source of truth is what we do and we can easily track changes
Depending on what you need either first or second solution may be better. In my company we use Netbox fork Nautobot along with Ansible. It’s Ansible that initiates the change and fills all the data properties in Nautobot. This way Ansible can also raise and close relevant change ticket at the right time. With your second solution it would be more difficult for us to properly work with change tickets in compliant way. If you ever intend to take compliance and ticketing system into account, then I would recommend going with first solution, otherwise both solutions are fine to me.