This commit is contained in:
2026-03-26 08:57:55 +01:00
parent 2b1ca2d5be
commit bb55664283
19 changed files with 2671 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
---
- name: Configure DHCP general settings
oxlorg.opnsense.dhcp_general:
firewall: "{{ opnsense_firewall }}"
api_key: "{{ opnsense_api_key }}"
api_secret: "{{ opnsense_api_secret }}"
ssl_verify: "{{ opnsense_ssl_verify }}"
api_port: "{{ opnsense_api_port }}"
enabled: "{{ opnsense_dhcp_enabled }}"
interfaces: "{{ opnsense_dhcp_interfaces }}"
fw_rules: "{{ opnsense_dhcp_fw_rules }}"
- name: Configure DHCP subnets
oxlorg.opnsense.dhcp_subnet:
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: [subnet]
subnet: "{{ item.subnet }}"
auto_options: false
pools: "{{ item.pools | default([]) }}"
gateway: "{{ item.gateway | default([]) }}"
dns: "{{ item.dns | default([]) }}"
domain: "{{ item.domain | default('') }}"
domain_search: "{{ item.domain_search | default([]) }}"
ntp_servers: "{{ item.ntp_servers | default([]) }}"
description: "{{ item.description | default(omit) }}"
state: "{{ item.state | default('present') }}"
loop: "{{ opnsense_dhcp_subnets }}"
- name: Configure DHCP reservations
oxlorg.opnsense.dhcp_reservation:
firewall: "{{ opnsense_firewall }}"
api_key: "{{ opnsense_api_key }}"
api_secret: "{{ opnsense_api_secret }}"
ssl_verify: "{{ opnsense_ssl_verify }}"
api_port: "{{ opnsense_api_port }}"
ip: "{{ item.ip }}"
mac: "{{ item.mac }}"
subnet: "{{ item.subnet | default(omit) }}"
hostname: "{{ item.hostname | default(omit) }}"
description: "{{ item.description | default(omit) }}"
state: "{{ item.state | default('present') }}"
loop: "{{ opnsense_dhcp_reservations }}"