Skip to content

Commit 9666ef7

Browse files
fix(roles/openvpn_server): use etc_t for file labels on RHEL 10
The SELinux type `openvpn_etc_t` was removed from the RHEL 10 core policy; only `openvpn_port_t` and the packet types remain. Setting `setype: openvpn_etc_t` on `server.p12` / `crl.pem` therefore failed with `invalid selinux context: [Errno 22] Invalid argument`. Introduce an OS-specific internal variable `__openvpn_server__selinux_etc_type` (default `openvpn_etc_t`, overridden to `etc_t` on RHEL 10) and parameterize both `setype:` assignments. On RHEL 10, `etc_t` is the appropriate default label since openvpn runs unconfined (no `openvpn_t` domain) there. Also mark `openvpn_server` as RHEL 10 compatible in COMPATIBILITY.md.
1 parent ce22b63 commit 9666ef7

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525

2626
### Fixed
2727

28+
* **role:openvpn_server**: Fix `invalid selinux context: [Errno 22] Invalid argument` on RHEL 10 when deploying `server.p12` / `crl.pem`. The SELinux type `openvpn_etc_t` no longer exists in the RHEL 10 core policy (only `openvpn_port_t` and the packet types remain). The role now uses `etc_t` on RHEL 10 via a new OS-specific internal variable `__openvpn_server__selinux_etc_type`; other platforms keep `openvpn_etc_t`
2829
* **role:repo_epel**: Fix malformed RHEL 10 `epel.repo`: a missing newline in the `[epel-source]` section rendered `enabled=0username=<login>` when `repo_epel__basic_auth_login` was set, causing dnf to reject the file with `Invalid configuration value: enabled=0username=...`
2930
* **role:infomaniak_vm**: Apply the VM's security group on the `ext-net1` port instead of (only) on the server. When a VM boots against a pre-created port, Neutron enforces the port's security groups, not those passed to the server, so without this the configured rules were silently ignored on the public interface
3031
* **role:logstash**: Default value of `logstash__java_opts` now caps JVM heap size at 8g.

COMPATIBILITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ nodejs | | | x | x | | | |
122122
objectstore_backup | | | x | | | | |
123123
opensearch | | | x | | | | |
124124
open_vm_tools | | | x | x | | | |
125-
openvpn_server | | | x | x | | | |
125+
openvpn_server | | | x | x | x | | |
126126
php | x | x | x | x | | | |
127127
podman_containers | | | | x | | | |
128128
policycoreutils | | | x | x | x | | | Fedora 35

roles/openvpn_server/tasks/main.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
- name: 'Set platform/version specific variables'
2+
ansible.builtin.import_role:
3+
name: 'shared'
4+
tasks_from: 'platform-variables.yml'
5+
tags:
6+
- 'always'
7+
8+
19
- block:
210

311
- name: 'Install openvpn'
@@ -60,7 +68,7 @@
6068
group: 'root'
6169
seuser: 'system_u'
6270
serole: 'object_r'
63-
setype: 'openvpn_etc_t'
71+
setype: '{{ __openvpn_server__selinux_etc_type }}'
6472
when:
6573
- 'not openvpn_server__pkcs12_skip_deploy'
6674

@@ -93,7 +101,7 @@
93101
group: 'openvpn'
94102
seuser: 'system_u'
95103
serole: 'object_r'
96-
setype: 'openvpn_etc_t'
104+
setype: '{{ __openvpn_server__selinux_etc_type }}'
97105
when:
98106
- 'not openvpn_server__crl_verify_skip_deploy'
99107

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__openvpn_server__selinux_etc_type: 'etc_t'

roles/openvpn_server/vars/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__openvpn_server__selinux_etc_type: 'openvpn_etc_t'

0 commit comments

Comments
 (0)