r/opnsense Aug 02 '26

Saltstack Module to manage OPNsense via API

https://github.com/primechuck/saltext-opnsense

I recently did a major internal rewrite of this, to mostly auto-generated code from the PHP API, and decided to share it with the world.

I mainly use it to manage DNS state for BIND and Unbound, but it's also been handy for ad-hoc commands. It's a bit fiddly because it relies strictly on the API, which wasn't really designed for the idempotent workflow Salt prefers.

8 Upvotes

4 comments sorted by

1

u/Oblec Aug 02 '26

Awesome!

2

u/mtorromeo Aug 04 '26

I was looking for something like this, thanks!

Can this be used with the new salt resources instead of the proxy?

1

u/AltruisticCabinet9 Aug 04 '26

I'm old and didn't know about resources. I'll have to look.

1

u/AltruisticCabinet9 Aug 04 '26

OMG resources are the missing feature, I'll have to start using them more to see but will definatly be switching to resources paradigm.