puzzle / puzzle.opnsense

An Ansible Collection to configure an opnsense Firewall
https://puzzle.github.io/puzzle.opnsense/collections/puzzle/opnsense/index.html
GNU General Public License v3.0
24 stars 12 forks source link

Introduce Setting Sync compatibility #148

Closed KiLLuuuhh closed 3 months ago

KiLLuuuhh commented 3 months ago

Is your feature request related to a problem? Please describe. With the update to version 24.7, a new setting Sync compatibility is required as seen in the GUI: image

Furthermore, the services to be sync can now be added via multi-select dropdown: image

These two changes do influence the xml-config in the following way:

  <hasync version="1.0.0">
    <disablepreempt>0</disablepreempt>
    <disconnectppps>0</disconnectppps>
    <pfsyncenabled>0</pfsyncenabled>
    <pfsyncinterface>lan</pfsyncinterface>
    <pfsyncpeerip/>
    <pfsyncversion>1400</pfsyncversion>
    <synchronizetoip/>
    <username/>
    <password/>
    <syncitems>captiveportal,cron,dhcpd</syncitems>
  </hasync>

I want to point out two relevant changes:

  1. A new element pfsyncversion is introduced which, according to my tests can either have the value 1400 for OPNsense 24.7 or above or 1301 for OPNsense 24.1[.x] or below.
  2. The syncelements are now a comma separated string other than a specific element per option.

Describe the solution you'd like The system_high_availability_settings module must be version-aware and generate a different XML for version 24.7.

Additional context Since the current module would break the 24.7 configuration, this changes must be made before adding 24.7 version compatibility.