ansibleguy / collection_opnsense

Ansible Collection to manage OPNSense firewalls using their API
https://opnsense.ansibleguy.net
GNU General Public License v3.0
257 stars 34 forks source link

Problem: route - not idempotent #99

Open mbx64 opened 2 weeks ago

mbx64 commented 2 weeks ago

Modules

route

Version

ansibleguy.opnsense           1.2.10

Ansible Version

ansible [core 2.15.12]
  config file = /home/user/.ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/.local/bin/ansible
  python version = 3.9.19 (main, Aug 23 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

OPNSense Version

24.1

OPNSense-Plugin Version

No response

Issue

When I use the following task to deploy a route:

- name: Configure route
  ansibleguy.opnsense.route:
    network: 172.16.0.0/24
    gateway: LAN_GW

The route will be added again with each execution. So it does not seem to be idempotent with the default match_fields (network and gateway). When I view the created routes in the web GUI, I see that their gateways are not called just LAN_GW, but LAN_GW - <GW_IP_ADDRESS>. Maybe the idempotency problem is related to this fact.

Config Ansible

No response

Config OPNSense

No response

Debug Output

No response

Profiling Output

No response