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 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
e18db424ec
commit
077d8715bf
4 files changed
+4
-5
No files matched your search
+1
-2
@@ -9,7 +9,7 @@ Ubuntu 24.04 (noble), the image the molecule scenario runs on. 22.04 (jammy) is
|
|||||||
## Requirements and run order
|
## Requirements and run order
|
||||||
|
|
||||||
- Use it by its fully qualified name, `mortis.kamino.ufw`.
|
- 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`.
|
- 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`.
|
- `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.
|
- `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
|
- name: Harden and firewall the servers
|
||||||
hosts: servers
|
hosts: servers
|
||||||
roles:
|
roles:
|
||||||
- role: mortis.kamino.system_baseline
|
|
||||||
- role: mortis.kamino.ufw
|
- role: mortis.kamino.ufw
|
||||||
vars:
|
vars:
|
||||||
ufw_rules:
|
ufw_rules:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ ufw_rules: []
|
|||||||
ufw_before_rules: []
|
ufw_before_rules: []
|
||||||
|
|
||||||
# Keys/values written into /etc/ufw/sysctl.conf so ufw's stock file does not
|
# 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: []
|
ufw_sysctl_overrides: []
|
||||||
|
|
||||||
# service_rules entry point. The owner tag is written into each rule's
|
# service_rules entry point. The owner tag is written into each rule's
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ argument_specs:
|
|||||||
description:
|
description:
|
||||||
- >-
|
- >-
|
||||||
List of C({name, value}) mappings written as C(name=value) into /etc/ufw/sysctl.conf, so UFW does not reset
|
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).
|
- C(name) uses slashes, for example C(net/ipv4/conf/all/log_martians).
|
||||||
service_rules:
|
service_rules:
|
||||||
short_description: Apply the firewall rules of one service, tagged with its name
|
short_description: Apply the firewall rules of one service, tagged with its name
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Install ufw
|
- name: Install ufw
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: mortis.kamino.ufw
|
name: ufw
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# An application profile whose name holds openssh, for the orphan seeds below.
|
# An application profile whose name holds openssh, for the orphan seeds below.
|
||||||
|
|||||||
Reference in new issue
Block a user