networktocode / ntc-netbox-plugin-onboarding

A plugin for NetBox to easily onboard new devices.
Other
245 stars 46 forks source link

Refactor of DNS resolving #112

Closed mzbroch closed 3 years ago

mzbroch commented 3 years ago

This PR standardises the process of DNS resolution in the Onboarding Plugin.

In the onboarding task, is it possible to specify a FQDN to be onboarded. Plugin is expected to resolve that name into IP address and use it for connections.

With this PR, a FQDN is resolved once per OT lifetime and rewritten into an ip_address attribute of the model. This assures consistency in all of the code and eliminates the need for accounting for IP/FQDN.

Fixes #106

glennmatthews commented 3 years ago

Looks reasonable. One thing that's not clear to me, does the entered FQDN still get stored anywhere in the final onboarded device?

mzbroch commented 3 years ago

Looks reasonable. One thing that's not clear to me, does the entered FQDN still get stored anywhere in the final onboarded device?

Not at the moment - We do resolution once the worker picks up the task and save resolved FQDN into the ip_address field.

mzbroch commented 3 years ago

@jvanderaa Let us know if this change solves your issue

jvanderaa commented 3 years ago

Checking still. In the interim we should also add the unit test that I have added on the branch uploaded. @mzbroch