browningluke / terraform-provider-opnsense

OPNsense Terraform Provider
https://registry.terraform.io/providers/browningluke/opnsense/latest
MIT License
57 stars 12 forks source link

Implement DHCP settings and static mappings #45

Closed achetronic closed 9 months ago

achetronic commented 9 months ago

Hello there :)

These days i'm reconfiguring my kubernetes cluster, migrating to Talos, and honestly, one of the most difficult things is always networking. Everything is easier using DHCP and assigning the IPs based on MAC addresses. This is something I would love to automate and this is why I am kindly requesting the support on the provider for this actions

browningluke commented 9 months ago

Hey there @achetronic

I understand this is one of the most valuable things this provider could offer (I, myself, would also benefit from it). However, it will not be implemented until OPNsense provides an API to configure static mappings - as currently it does not, despite lots of interest in it.

I made the decision to only implement resources (fully / mostly) covered by the OPNsense API with this provider, as managing other resources (through web-scraping, etc) adds infinitely more complexity. If this is something you would like, please look at dalet-oss/terraform-provider-opnsense, which takes the scraping approach.

achetronic commented 9 months ago

Oh, I understand :) thank you for the response!

discretizer commented 4 months ago

So this SHOULD be possible now with the new Kea DHCP server in the lastest OPNSense release. If I implemented a PR would you be willing to take a look?

browningluke commented 4 months ago

Hi there @discretizer

Do you know if it's documented on the OPNsense API reference yet? The only reference I could find to the Kea DHCP here was this.

However, that's besides the point. You're more than welcome to put together a PR and I'll take a look through it. I unfortunately don't have a contributors' guide yet, but hopefully the code style should be easy enough to glean from the other files. If you run into any issues, feel free to @ me.

discretizer commented 4 months ago

I think it's documented here: https://docs.opnsense.org/development/api/core/kea.html

I was going to take a stab and the contribution - obviously I'll start w/ opnsense-go first. Might get some time this week.

browningluke commented 4 weeks ago

Just noting for anyone who finds this issue.

DHCP reservations should now be possible on OPNsense 24.7 using provider version v0.11.0 onward.

Make sure to switch to Kea DHCP instead of the legacy ISC DHCP.

Kea reservation resource docs here