collection_opnsense
collection_opnsense copied to clipboard
Feature: Add Support for LAGG Interfaces
Link to API
https://docs.opnsense.org/development/api/core/interfaces.html#id3
Description
It would be nice to setup/manage the LAGG Interfaces with Ansible
Its the first time I try to implement a Module with the collection_opnsense Framework. It works for me currently but I am not so sure if the approach with match_fields is the correct one.
Greetings!
@jiuka Thank you for this very clean PR!
- You are right - the
match_fieldsdo not make sense in that case.
The match_fields are used to match the configured entry with any one that exists on the firewall. So in practice this value should never change as you could think of it as the ID of the entry.
Fields like members, primary_member or proto are not static. They could change. We would only fall-back to using those if we have no other option. But in this case we CAN use description or device as unique ID field.
Most modules of this collection only use the description field if it is available.
As an example:
You can see - if only one ID-field is used, we do not set the match_fields but the FIELD_ID (as there is no user-choice).
In this case you would need to set the description to be a required module argument.
- Some issue with the module arguments:
- Please add the
flowidalias to theuse_flowidargument - Please add the
fast_timeoutalias to thelacp_fast_timeoutargument - Please add the
parentalias to themembersargument - as that is the name in the WebUI - Please add the
hashandhash_layersaliases to thelagghashargument - As I see it - the default value of
lagghashshould be unset/empty as that is the default in the WebUI - The option
defaultof the argumentlacp_strictanduse_flowidshould not be an option as the option in the WebUI just sets the value to None/empty-string