Custom Netbox Dynamic Inventory Plugin for Ansible
December 16, 2018
In my sparetime i help a friend out automating some datacenter maintance stuff with Ansible!
He got a problem with the currenty netbox dynamic inventory in devel(pre 2.8) to be so slow and return to many vars he don’t need.
So if you know me i like to learn new stuff and sharpen some coding skills (My python is quite rusty!).
So here it is mostly 3-8 Hours depend how you define development work :-) and give a performance boost like over 9000% :-)
Its quite a simple dynamic inventory script, and i use the python libary ‘https://github.com/digitalocean/pynetbox’ for it, because how likes to code some requests response stuff and read api documentation.
https://github.com/daBONDi/ansible-inventory-an_netbox
It is quite a opinionated simple version!
Read the README.md in the Github Repo, don’t want to copy paste same stuff all over around :-)
And like always…
Improve, Automate, Rinse and Repeat!