28 lines
1.3 KiB
YAML
28 lines
1.3 KiB
YAML
---
|
|
- name: Configure firewall rules
|
|
oxlorg.opnsense.rule:
|
|
firewall: "{{ opnsense_firewall }}"
|
|
api_key: "{{ opnsense_api_key }}"
|
|
api_secret: "{{ opnsense_api_secret }}"
|
|
ssl_verify: "{{ opnsense_ssl_verify }}"
|
|
api_port: "{{ opnsense_api_port }}"
|
|
match_fields: "{{ item.match_fields | default(['description']) }}"
|
|
description: "{{ item.description }}"
|
|
sequence: "{{ item.sequence | default(1) }}"
|
|
action: "{{ item.action | default('pass') }}"
|
|
quick: "{{ item.quick | default(true) }}"
|
|
interface: "{{ item.interface | default(['lan']) }}"
|
|
direction: "{{ item.direction | default('in') }}"
|
|
ip_protocol: "{{ item.ip_protocol | default('inet') }}"
|
|
protocol: "{{ item.protocol | default('any') }}"
|
|
source_net: "{{ item.source_net | default('any') }}"
|
|
source_port: "{{ item.source_port | default(omit) }}"
|
|
source_invert: "{{ item.source_invert | default(false) }}"
|
|
destination_net: "{{ item.destination_net | default('any') }}"
|
|
destination_port: "{{ item.destination_port | default(omit) }}"
|
|
destination_invert: "{{ item.destination_invert | default(false) }}"
|
|
log: "{{ item.log | default(true) }}"
|
|
enabled: "{{ item.enabled | default(true) }}"
|
|
state: "{{ item.state | default('present') }}"
|
|
loop: "{{ opnsense_rules }}"
|