bb-Ricardo / netbox-sync

Sync objects from VMware or redfish sources to NetBox
MIT License
274 stars 60 forks source link

Feature Request: Add domain name if not already there #355

Open eric-eisenhart opened 8 months ago

eric-eisenhart commented 8 months ago

In netbox, we have everything as foo1.example.com and foo2.example.net, but in vcenter we have a mix of "foo1.example.com", "foo2.example.net" and "foo3" (.example.net implied).

Part of the issue is that there's various bits of automation tied to the netbox data, so renaming a VM from "foo2.example.net" to "foo2" could cause problems with other systems, make it harder for other automation to correlate hosts to netbox entries, etc... And renaming everything in vCenter is a huge pain...

So, basically, I want a "add example.net" config and a regex like .*example\.(com|net)$ or list like example.com, example.net to change these vcenter VM hostnames to these netbox names:

Theoretically the same concept could apply to ESX hosts, but there's quite a bit fewer of those and a lot less automation tied to their netbox entries. (also we already have all of them in vCenter with FQDNs)

eric-eisenhart commented 8 months ago

First pass at code for this in #356

bb-Ricardo commented 7 months ago

Added a comment to your PR