1
Development and Code Review / Re: Ansible Support for OPNSense?
« on: September 22, 2019, 03:05:41 pm »
Hi there,
while developing my Ansible modules for OPNsense's HAProxy, I have implemented a few generic helper functions which in theory could manipulate every kind of object via API.
These are for example:
However, as of now the functions / objects available through the API of OPNsense are indeed somewhat limited.
If there is more functionality to come to the API, I would gladly extend my Ansible modules to manage other datatypes as well (e.g. network objects and rules), or assist others doing so.
What @mimugmail states is definitely something that needs to be taken care of.
An API should (must) guarantee some sort of stability, so that stuff does not get broken.
That might be implemented by introducing API versions, which could be bound to a specific major version of the product, and then the API is guaranteed to stay stable for that specific version.
Cheers,
Markus
while developing my Ansible modules for OPNsense's HAProxy, I have implemented a few generic helper functions which in theory could manipulate every kind of object via API.
These are for example:
- low-level functions for HTTP GET and POST requests to the API
- CRUD operations (create, read, update, delete)
- checking the existence of an object
- find selected item in a list
- compare two lists
However, as of now the functions / objects available through the API of OPNsense are indeed somewhat limited.
If there is more functionality to come to the API, I would gladly extend my Ansible modules to manage other datatypes as well (e.g. network objects and rules), or assist others doing so.
What @mimugmail states is definitely something that needs to be taken care of.
An API should (must) guarantee some sort of stability, so that stuff does not get broken.
That might be implemented by introducing API versions, which could be bound to a specific major version of the product, and then the API is guaranteed to stay stable for that specific version.
Cheers,
Markus