Merge branch 'main' into feat/482-pve-vm-role
Build / build (pull_request) Successful in 56s
Lint / lint (pull_request) Successful in 4m48s
Molecule / molecule (pull_request) Successful in 37m37s

This commit is contained in:
Defame1297 committed 2026-12-01 20:13:01 +00:00
commit 773de8eba4
32 files changed
+1433 -101

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ Main entry point: `fail2ban` (everything), `fail2ban_install`, `fail2ban_validat
## Tests
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It runs `check` before the converge (a fresh host, where the image already has fail2ban installed) and after it (a configured host).
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It runs `check` before the converge (a fresh host, where the role installs fail2ban) and after it (a configured host).
- Converge applies the main entry point with an extra `fail2ban_ignoreip` network and calls `service_jail` twice, one jail with a `logpath` and one with a `journalmatch`.
- Converge also runs inputs that must be refused: a service filter without `failregex`, and a `fail2ban_ignoreip` entry with whitespace, a plain string instead of a list, and an entry starting with `;`. The `fail2ban_ignoreip` refusals are matched on their message.
@@ -3,7 +3,7 @@
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup and the
# firewall tools need NET_ADMIN, nothing else. Needs the network:
# prepare purges the fail2ban the image ships and refreshes the APT cache the image deletes.
# prepare purges any fail2ban and refreshes the APT cache the image deletes.
driver:
name: docker
platforms:
@@ -1,6 +1,6 @@
---
# The image ships fail2ban and no APT lists; the check step needs fail2ban gone and the lists back,
# or the install task cannot even preview the package.
# The purge keeps the scenario independent of what the image ships. The image keeps no APT lists,
# and the check step needs them, or the install task cannot even preview the package.
- name: Prepare a host without fail2ban
hosts: all
gather_facts: false
+7 -1
View File
@@ -1,9 +1,15 @@
---
# The log file a service jail watches must exist, or `fail2ban-client -t` fails.
# The image keeps no APT lists, and --check does not refresh them, so the fresh-host check needs
# them to preview the fail2ban install. The log file a service jail watches must exist, or
# `fail2ban-client -t` fails.
- name: Prepare
hosts: all
gather_facts: false
tasks:
- name: Refresh the APT cache
ansible.builtin.apt:
update_cache: true
- name: Create the log file the logpath jail watches
ansible.builtin.file:
path: /var/log/svc-a.log
+1 -1
View File
@@ -7,7 +7,7 @@
# the service starts) is not covered. The mint tasks only assert, but the remove-path play at the
# end of verify.yml needs systemd (it stops and disables a stub unit) and ufw (it deletes the Gitea
# rules), so the container runs systemd as PID 1 with a writable cgroup and NET_ADMIN. No
# privileged mode. Both images have ufw and gnupg preinstalled, so the scenario downloads nothing.
# privileged mode. Both images have gnupg preinstalled; prepare.yml installs ufw from the archive.
driver:
name: docker
platforms:
+12
View File
@@ -0,0 +1,12 @@
---
# The remove-path play in verify.yml needs ufw, which the image does not ship. It keeps no APT
# lists, so the install refreshes them.
- name: Prepare
hosts: all
gather_facts: false
tasks:
- name: Install ufw
ansible.builtin.apt:
name: ufw
state: present
update_cache: true
+1 -1
View File
@@ -3,7 +3,7 @@
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup and the
# firewall tools need NET_ADMIN, nothing else. Needs the network:
# prepare purges the ufw the image ships and refreshes the APT cache the image deletes.
# prepare purges any ufw and refreshes the APT cache the image deletes.
driver:
name: docker
platforms:
+2 -2
View File
@@ -1,6 +1,6 @@
---
# The image ships ufw and no APT lists; the check step needs ufw gone and the lists back, or the
# install task cannot even preview the package.
# The purge keeps the scenario independent of what the image ships. The image keeps no APT lists,
# and the check step needs them, or the install task cannot even preview the package.
- name: Prepare a host without ufw
hosts: all
gather_facts: false
+3 -1
View File
@@ -7,10 +7,12 @@
hosts: all
gather_facts: false
tasks:
# The image keeps no APT lists, so the install refreshes them.
- name: Install ufw
ansible.builtin.package:
ansible.builtin.apt:
name: ufw
state: present
update_cache: true
# An application profile whose name holds openssh, for the orphan seeds below.
- name: Define an application profile named like SSH