From 077d8715bf9ae0378e09f86acc6f421161fb7abc Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 14 Nov 2026 16:52:22 +0000 Subject: [PATCH] fix(ufw): install the ufw package in prepare and name system_baseline without its FQCN 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 Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm --- roles/ufw/README.md | 3 +-- roles/ufw/defaults/main.yml | 2 +- roles/ufw/meta/argument_specs.yml | 2 +- roles/ufw/molecule/default/prepare.yml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/ufw/README.md b/roles/ufw/README.md index 64cc671..f395785 100644 --- a/roles/ufw/README.md +++ b/roles/ufw/README.md @@ -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: diff --git a/roles/ufw/defaults/main.yml b/roles/ufw/defaults/main.yml index 767f591..ea16148 100644 --- a/roles/ufw/defaults/main.yml +++ b/roles/ufw/defaults/main.yml @@ -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 diff --git a/roles/ufw/meta/argument_specs.yml b/roles/ufw/meta/argument_specs.yml index 39fbbef..2907143 100644 --- a/roles/ufw/meta/argument_specs.yml +++ b/roles/ufw/meta/argument_specs.yml @@ -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 diff --git a/roles/ufw/molecule/default/prepare.yml b/roles/ufw/molecule/default/prepare.yml index 34b7539..18a10a1 100644 --- a/roles/ufw/molecule/default/prepare.yml +++ b/roles/ufw/molecule/default/prepare.yml @@ -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.