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
28 lines
1.7 KiB
YAML
28 lines
1.7 KiB
YAML
---
|
|
# Included by converge.yml after each orphan_rules case. The counts are absolute: svc_o1
|
|
# holds ufw_conv_o1_want rules (default ufw_conv_o1_initial: 2 before the purge, 0 after),
|
|
# and the tagged total is 20 plus those. The 20: svc_a 2, svc_b 2, svc_c 1, svc_e 2, svc_g 1,
|
|
# svc_h 2, svc_m 1, svc_o2 1, svc_o3 4 (kept orphans that may carry SSH), svc_p 4 (its
|
|
# desired rule and three kept stale rules).
|
|
- name: Read the rules ufw would load
|
|
ansible.builtin.command: ufw show added
|
|
register: ufw_conv_added
|
|
changed_when: false
|
|
environment: {LC_ALL: C}
|
|
|
|
- name: The seeds are as this case leaves them
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_o1:') | list | length == ufw_conv_o1_count | int
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_o2:3333333333') | list | length == 1
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_o3:555555555[1-4]') | list | length == 4
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_m:4444444444') | list | length == 1
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_p:666666666[123]') | list | length == 3
|
|
- ufw_conv_added.stdout_lines | select('search', 'svc_p:6666666664') | list | length == 0
|
|
- ufw_conv_added.stdout_lines | select('match', '^ufw ') | select('search', 'ansible-ufw') | list | length == 20 + ufw_conv_o1_count | int
|
|
- ufw_conv_added.stdout_lines | select('match', '^ufw ') | reject('search', 'ansible-ufw') | list | length == 5
|
|
fail_msg: "Unexpected rules after the orphan_rules case: {{ ufw_conv_added.stdout_lines }}"
|
|
quiet: true
|
|
vars:
|
|
ufw_conv_o1_count: "{{ ufw_conv_o1_want | default(ufw_conv_o1_initial) }}"
|