fix(ufw): install the ufw package in prepare and name system_baseline without its FQCN
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 25s
Molecule / molecule (pull_request) Successful in 7m55s

The rename to mortis.kamino.ufw also caught the package name in the scenario's prepare
step, so the package install failed. The role's docs named mortis.kamino.system_baseline,
which the role-independence test refuses; they now name the system_baseline role of this
Collection, and the README example no longer lists it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-11-14 16:52:22 +00:00
1 parent e18db424ec
commit 077d8715bf
4 files changed
+4 -5

No files matched your search

+1 -2
View File
@@ -9,7 +9,7 @@ Ubuntu 24.04 (noble), the image the molecule scenario runs on. 22.04 (jammy) is
## Requirements and run order
- Use it by its fully qualified name, `mortis.kamino.ufw`.
- Run `mortis.kamino.system_baseline` before this role. UFW's stock `/etc/ufw/sysctl.conf` re-applies sysctl values when UFW is enabled, which undoes baseline hardening. Mirror the baseline values in `ufw_sysctl_overrides`.
- Run the `system_baseline` role of this Collection before this role. UFW's stock `/etc/ufw/sysctl.conf` re-applies sysctl values when UFW is enabled, which undoes baseline hardening. Mirror the baseline values in `ufw_sysctl_overrides`.
- Main entry point: apply it in the play that hardens a host, after `system_baseline` and `systemd_hardening`, before `fail2ban`.
- `service_rules` entry point: called by each service role that owns firewall rules (`include_role` with `tasks_from: service_rules`), after the main entry point has run, passing `ufw_service_name` and `ufw_service_rules`.
- `orphan_rules` entry point: called once per host after every service role ran, with `ufw_managed_owners` set to the owners that are still managed.
@@ -45,7 +45,6 @@ Skipping `ufw_aggregate` leaves the lists the later tasks read (`ufw_aggregated_
- name: Harden and firewall the servers
hosts: servers
roles:
- role: mortis.kamino.system_baseline
- role: mortis.kamino.ufw
vars:
ufw_rules:
+1 -1
View File
@@ -19,7 +19,7 @@ ufw_rules: []
ufw_before_rules: []
# Keys/values written into /etc/ufw/sysctl.conf so ufw's stock file does not
# reset values set by mortis.kamino.system_baseline. Set per group of hosts.
# reset values set by the system_baseline role of this Collection. Set per group of hosts.
ufw_sysctl_overrides: []
# service_rules entry point. The owner tag is written into each rule's
+1 -1
View File
@@ -81,7 +81,7 @@ argument_specs:
description:
- >-
List of C({name, value}) mappings written as C(name=value) into /etc/ufw/sysctl.conf, so UFW does not reset
values set by mortis.kamino.system_baseline. The role default is an empty list.
values set by the system_baseline role of this Collection. The role default is an empty list.
- C(name) uses slashes, for example C(net/ipv4/conf/all/log_martians).
service_rules:
short_description: Apply the firewall rules of one service, tagged with its name
+1 -1
View File
@@ -9,7 +9,7 @@
tasks:
- name: Install ufw
ansible.builtin.package:
name: mortis.kamino.ufw
name: ufw
state: present
# An application profile whose name holds openssh, for the orphan seeds below.