Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for netbox-dns plugin #41

Open
apoxa opened this issue Jan 20, 2024 · 4 comments
Open

Support for netbox-dns plugin #41

apoxa opened this issue Jan 20, 2024 · 4 comments

Comments

@apoxa
Copy link

apoxa commented Jan 20, 2024

I'm using the netbox-dns-plugin, which extends NetBox with complete DNS zone management functionality. This adds additional features like zones and other record types. It'd be great if I could query this information from coredns with your plugin.

I had a look at the plugin code and have some ideas how to implement this. I'd add a boolean argument in setup.go, which toggles if the native API or the DNS plugin API is used.

case "zoneplugin":
	if !c.NextArg() {
		return nil, c.ArgErr()
	}
	zoneplugin, err := strconv.ParseBool(c.Val())
	if err != nil {
		return n, c.Errf("could not parse 'zoneplugin': %s", err)
	}
	n.ZonePlugin = zoneplugin

Then I'd convert func query() to a wrapper function which calls either the existing query() (renamed to e.g. queryNative()) function or a new function queryZonePlugin().

func (n *Netbox) query(host string, family int) ([]net.IP, error) {
	if n.ZonePlugin {
		return n.queryZonePlugin(host, family)
	}
	return n.queryNative(host, family)
}

I'd be happy to try and implement that functionality into your plugin, if you find this useful.

@oz123
Copy link
Owner

oz123 commented Jan 21, 2024

Seems like a useful thing.

@oz123 oz123 closed this as completed Jan 21, 2024
@oz123 oz123 reopened this Jan 21, 2024
@oz123
Copy link
Owner

oz123 commented Jan 21, 2024

Accidentally closed. Please submit a PR.

@bsirayne
Copy link

bsirayne commented Apr 4, 2024

Adding support for the netbox-dns plugin would be a game changer, in my opinion.

I don't think I'm skilled enough to help with the actual implementation, but if there's anything I can do to assist (even if that just means buying ya'll some coffee), please let me know! 😁

@oz123
Copy link
Owner

oz123 commented Apr 4, 2024

You can contact me in private. I am actually interested in that, I am just not interested in doing all the work for free.
A few coffees might be enough ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants