-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationsupportEnvironmental problems and so onEnvironmental problems and so on
Description
Modules
Rule
Version
1.2.12Ansible Version
2.18.1OPNSense Version
25.7.5OPNSense-Plugin Version
Issue
Setting enabled: false on a existing rule will not disable it, it will simply remove
This is not the behavior of the WebUI of OPNsense, since disabled rules are still shown in gray.
Here is an example:
---
- name: Disable a Rule makes it disappear
hosts: opnsense
gather_facts: false
collections:
- ansibleguy.opnsense
vars:
# === Required connection details ===
opnsense_host: 192.0.2.10 # e.g. firewall IP or FQDN
opnsense_api_key: "YOUR_API_KEY"
opnsense_api_secret: "YOUR_API_SECRET"
opnsense_port: 443
opnsense_ssl_verify: false # set true if you have valid certs
module_defaults:
group/ansibleguy.opnsense.all:
firewall:
host: "{{ opnsense_host }}"
port: "{{ opnsense_port }}"
api_key: "{{ opnsense_api_key }}"
api_secret: "{{ opnsense_api_secret }}"
ssl_verify: "{{ opnsense_ssl_verify }}"
tasks:
- name: Create rule
ansibleguy.opnsense.rule:
interface: []
source_net: 'test-network'
destination_net: 'any'
destination_port: 53
protocol: 'UDP'
description: 'new rule'
match_fields: ['description']
- name: Disable this rule
ansibleguy.opnsense.rule:
description: 'new rule'
match_fields: ['description']
enabled: falseConfig Ansible
Config OPNSense
Debug Output
Profiling Output
superstes
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationsupportEnvironmental problems and so onEnvironmental problems and so on