Copied from the environment repository's local role. The files are identical except: galaxy namespace mortis; comments, argument_specs descriptions and the README scrubbed of environment references (issue numbers, CI runs, playbooks, inventory paths and groups, scripts and caller roles by name), with the technical explanation kept and reworded generically; the stray-variable guard's fail message drops its issue reference; the molecule scenario calls the role by its FQCN (mortis.kamino.ufw), follows the Kamino scenario conventions (kamino-molecule header, scenario.test_sequence) and no longer sets ANSIBLE_COLLECTIONS_PATH or ANSIBLE_ROLES_PATH. No variable, default, argument_specs type or task logic changed; the test coverage is the same. The README follows the other Kamino roles: purpose, the main, service_rules and orphan_rules entry points, variables, and example plays with the FQCN and tasks_from. The meta licence stays GPL-3.0-or-later AND GPL-3.0-only (templates/before.rules.j2 is derived from ufw's own file, already annotated in REUSE.toml and NOTICE). galaxy.yml's dependency comment names ufw as a community.general user. Not verified locally: the molecule scenario (it runs on the kamino-molecule runner in CI) and ansible-test sanity. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
22 lines
990 B
YAML
22 lines
990 B
YAML
---
|
|
# Build the lists the later tasks read: ufw_aggregated_rules from the base
|
|
# ufw_rules and ufw_aggregated_before_rules from the base ufw_before_rules.
|
|
#
|
|
# Rules of service roles are NOT collected here. Variables named *_ufw_rules
|
|
# or *_ufw_before_rules are not discovered and fail the guard in main.yml: a service role passes
|
|
# its rules explicitly through tasks_from: service_rules. No role contributes
|
|
# before-rules, so they stay a base-only list.
|
|
#
|
|
# The lists are still rebuilt (not appended) on every invocation, because
|
|
# set_fact persists for the rest of the play and the role can run more than
|
|
# once per host in a play.
|
|
- name: Set the rules to apply from the base ufw_rules
|
|
ansible.builtin.set_fact:
|
|
ufw_aggregated_rules: "{{ ufw_rules | default([]) }}"
|
|
when: ufw_manage_rules
|
|
|
|
- name: Set the before.rules entries from the base ufw_before_rules
|
|
ansible.builtin.set_fact:
|
|
ufw_aggregated_before_rules: "{{ ufw_before_rules | default([]) }}"
|
|
when: ufw_enabled
|