core icon indicating copy to clipboard operation
core copied to clipboard

Add interface assignments to API

Open black3x3 opened this issue 9 months ago • 7 comments

Although the issue is closed, I have worked on it as I also need this functionality. Additionally, I have opened two pull requests in the following repositories: - https://github.com/browningluke/terraform-provider-opnsense - https://github.com/browningluke/opnsense-go repositories

I would appreciate a review and would be happy to improve the quality of the changes.

black3x3 avatar Mar 14 '25 08:03 black3x3

Unfortunately this is unlikely to mature as it will need a lot of time from our end to bring this to the finish line. In order to include an api on a component on our end, the ui parts should also be finished. I'll keep the ticket open for when we start planning the work on our end.

AdSchellevis avatar Mar 14 '25 08:03 AdSchellevis

Unfortunately this is unlikely to mature as it will need a lot of time from our end to bring this to the finish line. In order to include an api on a component on our end, the ui parts should also be finished. I'll keep the ticket open for when we start planning the work on our end.

Hello, thank you for your answer!

In order to include an api on a component on our end, the ui parts should also be finished

Could you please take a look in this PR? The "Assignment" UI is already in place, so i fail to see which UI has to be written here. I can however extend the UI too, if needed

I'll keep the ticket open for when we start planning the work on our end.

It is a working PR, which together with the other two related PRs (see the description) that allow users to access it programmatically via terraform

@fichtner moooin if we cannot get this code into the mainline, would be a possible/good idea to write it as plugin? I am wondering if it doesn't get merged, how to keep my opnsense up-to-date and still apply my custom code ❓

vpereira avatar Mar 21 '25 11:03 vpereira

.. Could you please take a look in this PR? The "Assignment" UI is already in place,...

It's not as there's no user interface using the exact same endpoints (which is a requirement).

moooin if we cannot get this code into the mainline, would be a possible/good idea to write it as plugin?

best keep the plugin local at your end, no need to push it to our repository.

Eventually we will refactor the assignments as well, it's just not yet on the list.

AdSchellevis avatar Mar 21 '25 12:03 AdSchellevis

@vpereira hi there long time no see :) it's on my wish list and why we have cleaned up the interface.php page already WRT PPP devices, but it's such a huge chunk of work that this won't be happening this year for sure. Also we have had bad experiences with interim solutions such as this in the past. What's your current use case?

fichtner avatar Mar 21 '25 12:03 fichtner

@vpereira hi there long time no see :)

Hey @fichtner yeah, too long actually :)

What's your current use case?

We are in the pursuit of automating stuff with Terraform, and with this PR in combination with https://github.com/browningluke/terraform-provider-opnsense/pull/60 is a huge leap forward. Our goal is to handle OPNsense change requests in a GitOps style, so we can deploy them via CI/CD and all that jazz. It's what the cool kids do these days 😄

vpereira avatar Mar 21 '25 14:03 vpereira

I'll just leave it here: https://github.com/opnsense/core/issues/7324#issuecomment-2830694222

szymczag avatar Apr 25 '25 19:04 szymczag

Would love to see that implemented. I’m currently developing a plugin that manages WireGuard instances and peers, but I’m currently unable to continue the automation because the interface assignment functionality lacks an API :(

M4jx avatar Oct 11 '25 22:10 M4jx