Skip to content

Commit 3ea6e9e

Browse files
Drop OPNsense 23.1 support (#168)
* Remove 23.1 from molecule tests * Remove 23.1 from module index * Remove conditional alias checks for 23.1 * Add changelog for 23.1 deprecation * Fix unused import
1 parent b8e704e commit 3ea6e9e

File tree

12 files changed

+7
-250
lines changed

12 files changed

+7
-250
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
deprecated_features:
3+
- OPNsense 23.1 support has been deprecated

molecule/firewall_alias/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

molecule/firewall_rules/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

molecule/interfaces_assignments/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

molecule/opnsense_config/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

molecule/system_access_users/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ driver:
1818
parallel: true
1919

2020
platforms:
21-
- name: "23.1"
22-
box: puzzle/opnsense
23-
hostname: false
24-
box_version: "23.1"
25-
memory: 1024
26-
cpus: 2
27-
instance_raw_config_args:
28-
- 'vm.guest = :freebsd'
29-
- 'ssh.sudo_command = "%c"'
30-
- 'ssh.shell = "/bin/sh"'
3121
- name: "23.7"
3222
box: puzzle/opnsense
3323
hostname: false

molecule/system_high_availability_settings/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ driver:
1515
parallel: true
1616

1717
platforms:
18-
- name: "23.1"
19-
box: puzzle/opnsense
20-
hostname: false
21-
box_version: "23.1"
22-
memory: 1024
23-
cpus: 2
24-
instance_raw_config_args:
25-
- 'vm.guest = :freebsd'
26-
- 'ssh.sudo_command = "%c"'
27-
- 'ssh.shell = "/bin/sh"'
2818
- name: "23.7"
2919
box: puzzle/opnsense
3020
hostname: false

molecule/system_settings_general/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

molecule/system_settings_logging/molecule.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ driver:
1616
parallel: true
1717

1818
platforms:
19-
- name: "23.1"
20-
box: puzzle/opnsense
21-
hostname: false
22-
box_version: "23.1"
23-
memory: 1024
24-
cpus: 2
25-
instance_raw_config_args:
26-
- 'vm.guest = :freebsd'
27-
- 'ssh.sudo_command = "%c"'
28-
- 'ssh.shell = "/bin/sh"'
2919
- name: "23.7"
3020
box: puzzle/opnsense
3121
hostname: false

plugins/module_utils/firewall_alias_utils.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from ansible_collections.puzzle.opnsense.plugins.module_utils import xml_utils
1515
from ansible_collections.puzzle.opnsense.plugins.module_utils.config_utils import (
1616
OPNsenseModuleConfig,
17-
UnsupportedModuleSettingError,
1817
)
1918
from ansible_collections.puzzle.opnsense.plugins.module_utils.system_access_users_utils import (
2019
Group,
@@ -659,18 +658,7 @@ def add_or_update(self, alias: FirewallAlias) -> None:
659658
self.is_interface(alias.interface)
660659

661660
if alias.type == FirewallAliasType.OPNVPNGROUP:
662-
if self.opnsense_version > "23.1":
663-
self.set_authgroup(type_opnvpngroup_alias=alias)
664-
else:
665-
raise UnsupportedModuleSettingError(
666-
f"OPNVPNGROUP type is not supported in OPNsense {self.opnsense_version}"
667-
)
668-
669-
if alias.type in [FirewallAliasType.DYNAMICIPV6HOST, FirewallAliasType.BGPASN]:
670-
if self.opnsense_version < "23.7":
671-
raise UnsupportedModuleSettingError(
672-
f"{alias.type} type is not supported in OPNsense {self.opnsense_version}"
673-
)
661+
self.set_authgroup(type_opnvpngroup_alias=alias)
674662

675663
existing_alias: Optional[FirewallAlias] = next(
676664
(a for a in self._aliases if a.name == alias.name), None

plugins/module_utils/module_index.py

Lines changed: 0 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -29,159 +29,6 @@
2929
"""
3030
# pylint: disable=duplicate-code; Since this is rewritten in some tests.
3131
VERSION_MAP = {
32-
"23.1": {
33-
"system_settings_general": {
34-
"hostname": "system/hostname",
35-
"domain": "system/domain",
36-
"timezone": "system/timezone",
37-
# Add other mappings here
38-
"php_requirements": [
39-
"/usr/local/etc/inc/config.inc",
40-
"/usr/local/etc/inc/util.inc",
41-
"/usr/local/etc/inc/filter.inc",
42-
"/usr/local/etc/inc/system.inc",
43-
"/usr/local/etc/inc/interfaces.inc",
44-
],
45-
"configure_functions": {
46-
"system_timezone_configure": {
47-
"name": "system_timezone_configure",
48-
"configure_params": ["true"],
49-
},
50-
"system_trust_configure": {
51-
"name": "system_trust_configure",
52-
"configure_params": ["true"],
53-
},
54-
"system_hostname_configure": {
55-
"name": "system_hostname_configure",
56-
"configure_params": ["true"],
57-
},
58-
"system_hosts_generate": {
59-
"name": "system_hosts_generate",
60-
"configure_params": ["true"],
61-
},
62-
"system_resolvconf_generate": {
63-
"name": "system_resolvconf_generate",
64-
"configure_params": ["true"],
65-
},
66-
"plugins_configure_dns": {
67-
"name": "plugins_configure",
68-
"configure_params": ["'dns'", "true"],
69-
},
70-
"plugins_configure_dhcp": {
71-
"name": "plugins_configure",
72-
"configure_params": ["'dhcp'", "true"],
73-
},
74-
"filter_configure": {
75-
"name": "filter_configure",
76-
"configure_params": ["true"],
77-
},
78-
},
79-
},
80-
"system_settings_logging": {
81-
"preserve_logs": "syslog/preservelogs",
82-
# Add other mappings here
83-
"php_requirements": [
84-
"/usr/local/etc/inc/config.inc",
85-
"/usr/local/etc/inc/util.inc",
86-
"/usr/local/etc/inc/system.inc",
87-
],
88-
"configure_functions": {
89-
"system_settings_logging": {
90-
"name": "system_syslog_start",
91-
"configure_params": ["true"],
92-
},
93-
},
94-
},
95-
"system_access_users": {
96-
"users": "system/user",
97-
"uid": "system/nextuid",
98-
"gid": "system/nextgid",
99-
"system": "system",
100-
"maximumtableentries": "system/maximumtableentries",
101-
"php_requirements": [
102-
"/usr/local/etc/inc/system.inc",
103-
],
104-
"configure_functions": {},
105-
},
106-
"password": {
107-
"php_requirements": [
108-
"/usr/local/etc/inc/auth.inc",
109-
],
110-
"configure_functions": {
111-
"password": {
112-
"name": "echo password_hash",
113-
"configure_params": [
114-
"'password'",
115-
"PASSWORD_BCRYPT",
116-
"[ 'cost' => 11 ]",
117-
],
118-
},
119-
},
120-
},
121-
"firewall_rules": {
122-
"rules": "filter",
123-
"php_requirements": [
124-
"/usr/local/etc/inc/config.inc",
125-
"/usr/local/etc/inc/util.inc", # required for the service_log utility
126-
"/usr/local/etc/inc/interfaces.inc",
127-
"/usr/local/etc/inc/filter.inc",
128-
"/usr/local/etc/inc/system.inc",
129-
],
130-
"configure_functions": {
131-
"system_cron_configure": {
132-
"name": "system_cron_configure",
133-
"configure_params": ["true"],
134-
},
135-
"filter_configure": {
136-
"name": "filter_configure",
137-
"configure_params": [],
138-
},
139-
},
140-
},
141-
"interfaces_assignments": {
142-
"interfaces": "interfaces",
143-
# Add other mappings here.
144-
"php_requirements": [
145-
"/usr/local/etc/inc/config.inc",
146-
"/usr/local/etc/inc/util.inc",
147-
"/usr/local/etc/inc/filter.inc",
148-
"/usr/local/etc/inc/system.inc",
149-
"/usr/local/etc/inc/rrd.inc",
150-
"/usr/local/etc/inc/interfaces.inc",
151-
],
152-
"configure_functions": {
153-
"filter_configure": {
154-
"name": "filter_configure",
155-
"configure_params": [],
156-
},
157-
},
158-
},
159-
"system_high_availability_settings": {
160-
# Add other mappings here
161-
"hasync": "hasync",
162-
"synchronize_states": "hasync/pfsyncenabled",
163-
"synchronize_interface": "hasync/pfsyncinterface",
164-
"synchronize_peer_ip": "hasync/pfsyncpeerip",
165-
"synchronize_config_to_ip": "hasync/synchronizetoip",
166-
"remote_system_username": "hasync/username",
167-
"remote_system_password": "hasync/password",
168-
"disable_preempt": "hasync/disablepreempt",
169-
"disconnect_dialup_interfaces": "hasync/disconnectppps",
170-
"php_requirements": [
171-
"/usr/local/etc/inc/interfaces.inc",
172-
"/usr/local/etc/inc/util.inc",
173-
"/usr/local/etc/inc/config.inc",
174-
"/usr/local/etc/inc/plugins.inc",
175-
],
176-
"configure_functions": {},
177-
},
178-
"firewall_alias": {
179-
"alias": "OPNsense/Firewall/Alias/aliases",
180-
"geoip": "OPNsense/Firewall/Alias/geoip",
181-
"php_requirements": [],
182-
"configure_functions": {},
183-
},
184-
},
18532
"23.7": {
18633
"system_settings_general": {
18734
"hostname": "system/hostname",

plugins/modules/firewall_alias.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@
4747
- networkgroup (Combine different network type aliases into one)
4848
- macaddress (MAC address or partial mac addresses like f4:90:ea)
4949
- bgpasn (Maps autonomous system (AS) numbers to networks where they
50-
are responsible for) supported >= version 23.7
50+
are responsible for) supported
5151
- dynamicipv6host (A Host entry that will auto update on a
52-
prefixchange) supported >= version 23.7
53-
- opnvpngroup (Map user groups to logged in OpenVPN users) supported
54-
>= version 23.1
52+
prefixchange) supported
53+
- opnvpngroup (Map user groups to logged in OpenVPN users)
5554
- internal (Internal aliases which are managed by the product)
5655
- external (Externally managed alias, this only handles the
5756
placeholder. Content is set from another source (plugin, api call,

0 commit comments

Comments
 (0)