test(roles): run the Ubuntu roles on 24.04 and 26.04 and declare exactly those #381
No files matched your search
@@ -0,0 +1,7 @@
|
||||
---
|
||||
breaking_changes:
|
||||
- >-
|
||||
sshd, system_baseline, systemd_hardening, ufw, user_management - No longer declare Ubuntu
|
||||
22.04 (``jammy``). A platform a role declares is one it passes Molecule on in CI.
|
||||
- >-
|
||||
docker - Declares Ubuntu 24.04 (``noble``) only instead of every Ubuntu release (``all``).
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
minor_changes:
|
||||
- >-
|
||||
cloudflared, fail2ban, gitea_runner, pihole, sshd, system_baseline, systemd_hardening, traefik,
|
||||
ufw, user_management - Declare and are tested on Ubuntu 26.04 (``resolute``) next to 24.04
|
||||
(``noble``).
|
||||
@@ -3,7 +3,7 @@
|
||||
A disposable **Ubuntu 26.04** test target for the molecule scenarios of the
|
||||
[`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Ansible Collection: a container that behaves like a small
|
||||
26.04 host (systemd as PID 1), so a role can be converged and verified in it without a VM.
|
||||
It is the release the hosts are moving to; the roles are tested on it next to 24.04.
|
||||
It is the release the hosts are moving to; every role scenario whose role declares `resolute` runs on it next to 24.04.
|
||||
|
||||
## What is in it
|
||||
|
||||
|
||||
+3
-3
@@ -76,9 +76,9 @@ names a check that does not exist yet and its backlog issue.
|
||||
|
||||
- **Declared means tested.** A platform in `meta/main.yml` is one the role passes Molecule on in
|
||||
CI; one used but untested goes only in a README "Untested platforms" line. Accepted until the
|
||||
Debian image (#226) and the platform cleanup (#133) land: `trixie` declared untested, and
|
||||
`jammy` or `all` still declared. *Why:* no tool reads the declaration, so it is worth something
|
||||
only if true. *Held:* review.
|
||||
Debian image (#226) lands: `trixie` declared untested, and Debian `all` in network_interfaces;
|
||||
and until the 26.04 molecule image is fixed (#376): `docker` and `gitea` declare `noble` only.
|
||||
*Why:* no tool reads the declaration, so it is worth something only if true. *Held:* review.
|
||||
- **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and
|
||||
`resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS.
|
||||
*Why:* testing on hosts a role never runs on proves nothing. *Held:* review.
|
||||
|
||||
@@ -9,6 +9,9 @@ calling role does the download and the verification (a checksum, a signature, a
|
||||
each upstream differs) and stages the verified file next to the live binary before it includes
|
||||
this role, so a slow or failed download never stops the service.
|
||||
|
||||
It covers Ubuntu only: only the Collection's Ubuntu-targeting roles call it, so it does not
|
||||
cover Debian trixie.
|
||||
|
||||
Variables and their types are defined in [`meta/argument_specs.yml`](meta/argument_specs.yml),
|
||||
which is the source of truth.
|
||||
|
||||
@@ -63,9 +66,10 @@ itself always stops and starts the service.
|
||||
|
||||
## Testing
|
||||
|
||||
Two molecule scenarios run on Ubuntu 24.04 (noble) against stub binaries (shell scripts) under
|
||||
a stub unit, with no network: `default` covers a successful bump, its idempotence, a binary
|
||||
that cannot start, a binary that reports another version (both rolled back), a run with nothing
|
||||
Two molecule scenarios run in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and
|
||||
`${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). They run against stub binaries (shell scripts) under a
|
||||
stub unit, with no network: `default` covers a successful bump, its idempotence, a binary that
|
||||
cannot start, a binary that reports another version (both rolled back), a run with nothing
|
||||
staged (the service is not stopped), a direct call from a play (refused) and a first install
|
||||
with nothing to back up. `check_mode` runs the bump under `--check` against a stopped service
|
||||
and checks that nothing changed. The calling roles' own scenarios cover a real upstream binary.
|
||||
|
||||
@@ -11,6 +11,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- systemd
|
||||
- update
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). Needs no network: the "binaries"
|
||||
# are stub shell scripts written by ../resources/prepare.yml, run by a stub systemd unit. The
|
||||
# test caller role lives in ../resources/roles, because the role refuses a call from a play.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. Needs no network: the "binaries" are stub shell scripts written by
|
||||
# ../resources/prepare.yml, run by a stub systemd unit. The test caller role lives in
|
||||
# ../resources/roles, because the role refuses a call from a play.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -21,6 +22,21 @@ platforms:
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-binary-update-check-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
env:
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). Needs no network: the "binaries"
|
||||
# are stub shell scripts written by ../resources/prepare.yml, run by a stub systemd unit. The
|
||||
# test caller role lives in ../resources/roles, because the role refuses a call from a play.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. Needs no network: the "binaries" are stub shell scripts written by
|
||||
# ../resources/prepare.yml, run by a stub systemd unit. The test caller role lives in
|
||||
# ../resources/roles, because the role refuses a call from a play.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -21,6 +22,21 @@ platforms:
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-binary-update-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
env:
|
||||
|
||||
@@ -4,7 +4,7 @@ Installs cloudflared as a systemd service for a locally managed Cloudflare Tunne
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The role downloads the `cloudflared-linux-amd64` binary only, so other architectures are unsupported, and it needs `systemd`. The tasks that call the Cloudflare API run on the controller (`delegate_to: localhost`) and need the `community.general` collection (`cloudflare_dns`) there; the `mint` entry point also needs the `openssl` command on the controller. The target needs outbound access to github.com and to Cloudflare's edge; the role defines no firewall rules because the daemon only connects outbound.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The role downloads the `cloudflared-linux-amd64` binary only, so other architectures are unsupported, and it needs `systemd`. The tasks that call the Cloudflare API run on the controller (`delegate_to: localhost`) and need the `community.general` collection (`cloudflare_dns`) there; the `mint` entry point also needs the `openssl` command on the controller. The target needs outbound access to github.com and to Cloudflare's edge; the role defines no firewall rules because the daemon only connects outbound.
|
||||
|
||||
The role targets Ubuntu hosts that run the tunnel daemon, not Proxmox nodes, so it does not cover Debian trixie.
|
||||
|
||||
@@ -106,7 +106,7 @@ Remove with `-e "cloudflared_remove=true cloudflared_remove_data=true"`; only `c
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs on one platform, Ubuntu 24.04 (noble) (`${MOLECULE_IMAGE}`), without Cloudflare: a stub cloudflared binary stands in for the daemon, the downloads come from local `file://` URLs, and a stub of the Cloudflare API on the controller's loopback (`molecule/default/files/cloudflare_api_stub.py`, reached through `cloudflared_api_base_url`) answers the tunnel, zone and DNS record calls. It covers the converge with `cloudflared_manage_dns` false and an update through `_binary_update` (and its idempotence), the rendered `config.yml`, credentials file and unit, a stale credentials file, a failed checksum that leaves the daemon running, the input asserts, the deleted-tunnel and DNS guards, the `mint` entry point (confirm guard, CI refusal, no-op, check mode and a mint against the stub, run as child processes) and the remove path. The `community.general.cloudflare_dns` calls, which cannot be pointed at the stub, are not covered: creating, pruning and deleting records.
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It runs without Cloudflare: a stub cloudflared binary stands in for the daemon, the downloads come from local `file://` URLs, and a stub of the Cloudflare API on the controller's loopback (`molecule/default/files/cloudflare_api_stub.py`, reached through `cloudflared_api_base_url`) answers the tunnel, zone and DNS record calls. It covers the converge with `cloudflared_manage_dns` false and an update through `_binary_update` (and its idempotence), the rendered `config.yml`, credentials file and unit, a stale credentials file, a failed checksum that leaves the daemon running, the input asserts, the deleted-tunnel and DNS guards, the `mint` entry point (confirm guard, CI refusal, no-op, check mode and a mint against the stub, run as child processes) and the remove path. The `community.general.cloudflare_dns` calls, which cannot be pointed at the stub, are not covered: creating, pruning and deleting records.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- cloudflared
|
||||
- cloudflare
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No Cloudflare and no real
|
||||
# cloudflared: prepare.yml starts a stub of the Cloudflare API on the controller's loopback
|
||||
# (files/cloudflare_api_stub.py, reached through cloudflared_api_base_url; cleanup.yml stops it)
|
||||
# and seeds a stub cloudflared binary that reports an older version, so the update downloads its
|
||||
# new stub from local file:// URLs. The scenario downloads nothing. cloudflared_manage_dns is
|
||||
# false here because community.general.cloudflare_dns cannot be pointed at the stub; the DNS
|
||||
# guards in front of it are run with it true in verify.yml.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No Cloudflare and no real cloudflared: prepare.yml starts a stub of
|
||||
# the Cloudflare API on the controller's loopback (files/cloudflare_api_stub.py, reached through
|
||||
# cloudflared_api_base_url; cleanup.yml stops it) and seeds a stub cloudflared binary that reports
|
||||
# an older version, so the update downloads its new stub from local file:// URLs. The scenario
|
||||
# downloads nothing. cloudflared_manage_dns is false here because community.general.cloudflare_dns
|
||||
# cannot be pointed at the stub; the DNS guards in front of it are run with it true in verify.yml.
|
||||
# The container runs systemd as PID 1 with a writable cgroup; no privileged mode.
|
||||
driver:
|
||||
name: docker
|
||||
@@ -26,6 +26,21 @@ platforms:
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-cloudflared-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
# One source for every play, so a verify play that runs the role again renders the same
|
||||
|
||||
@@ -6,7 +6,7 @@ Installs Docker Engine from the upstream Docker APT repository, optionally updat
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The key and repository URLs point at `download.docker.com/linux/ubuntu`, and the source line uses `ansible_distribution_release`. The apt architecture is derived from the host (`x86_64` gives `amd64`, `aarch64` gives `arm64`); any other architecture fails the play until `docker_apt_arch` is set. A limited molecule scenario covers the role's own logic (see [Tests](#tests)); the real Docker Engine is not tested.
|
||||
|
||||
Untested platforms: Ubuntu releases other than 24.04; `meta/main.yml` declares Ubuntu `all`.
|
||||
Ubuntu 26.04 (resolute) is not declared yet: the 26.04 molecule image lacks gnupg, which the scenario needs.
|
||||
|
||||
The role targets Ubuntu hosts only: it installs from Docker's Ubuntu repository, so it does not cover Debian trixie (Proxmox hosts).
|
||||
|
||||
@@ -88,7 +88,7 @@ With any of `docker_daemon_options`, `docker_live_restore`, `docker_log_driver`,
|
||||
|
||||
## Tests
|
||||
|
||||
`molecule/default` runs in CI only (`.gitea/workflows/molecule.yml`, no local runner), on one platform: Ubuntu 24.04 (noble), the `molecule-ubuntu2404` test container (`${MOLECULE_IMAGE}`). A real Docker Engine cannot run there: `dockerd` needs the bridge, iptables rules and a delegated cgroup, and the container has no privileged mode. So the scenario builds a local APT repository, signs it with a throwaway key, and points the role at it with `docker_gpg_url` and `docker_repo_base_url`. The repository holds empty stand-ins for `docker-ce`, `docker-ce-cli` and `containerd.io`. The stand-in `docker-ce` ships a stub `docker.service` (`sleep infinity`) and creates the `docker` group, as the real package does.
|
||||
`molecule/default` runs in CI only (`.gitea/workflows/molecule.yml`, no local runner), on one platform: `${MOLECULE_IMAGE}` (Ubuntu 24.04). A real Docker Engine cannot run there: `dockerd` needs the bridge, iptables rules and a delegated cgroup, and the container has no privileged mode. So the scenario builds a local APT repository, signs it with a throwaway key, and points the role at it with `docker_gpg_url` and `docker_repo_base_url`. The repository holds empty stand-ins for `docker-ce`, `docker-ce-cli` and `containerd.io`. The stand-in `docker-ce` ships a stub `docker.service` (`sleep infinity`) and creates the `docker` group, as the real package does.
|
||||
|
||||
What it shows, with the role's tasks running unchanged:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
- noble
|
||||
galaxy_tags:
|
||||
- docker
|
||||
- containers
|
||||
|
||||
@@ -4,7 +4,7 @@ Installs Fail2Ban, writes `/etc/fail2ban/jail.local` from `fail2ban_jails`, ensu
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The default `sshd` jail reads the systemd journal because sshd logs there on that release. The role installs `python3-systemd`, which `backend = systemd` jails need.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The default `sshd` jail reads the systemd journal because sshd logs there on those releases. The role installs `python3-systemd`, which `backend = systemd` jails need.
|
||||
|
||||
Ubuntu hosts only: the role targets the Ubuntu guests whose `system_baseline` profiles install `fail2ban`; Proxmox hosts are not targeted.
|
||||
|
||||
@@ -82,7 +82,7 @@ Main entry point: `fail2ban` (everything), `fail2ban_install`, `fail2ban_validat
|
||||
|
||||
## Tests
|
||||
|
||||
The scenario `molecule/default/` runs in CI only, on one platform: `${MOLECULE_IMAGE}`, an Ubuntu 24.04 (noble) container. The sequence runs prepare, converge, idempotence, side effect and verify; it has no check-mode step.
|
||||
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). The sequence runs prepare, converge, idempotence, side effect and verify; it has no check-mode step.
|
||||
|
||||
- Converge applies the main entry point with an extra `fail2ban_ignoreip` network and calls `service_jail` twice, one jail with a `logpath` and one with a `journalmatch`.
|
||||
- Converge also runs inputs that must be refused: a service filter without `failregex`, and a `fail2ban_ignoreip` entry with whitespace, a plain string instead of a list, and an entry starting with `;`. The `fail2ban_ignoreip` refusals are matched on their message.
|
||||
|
||||
@@ -10,6 +10,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- fail2ban
|
||||
- security
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No privileged mode: systemd needs a
|
||||
# writable cgroup and the firewall tools need NET_ADMIN, nothing else.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup and the
|
||||
# firewall tools need NET_ADMIN, nothing else.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -22,6 +23,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-fail2ban-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
|
||||
@@ -6,6 +6,8 @@ Installs the Gitea git service as a systemd-managed binary with a GPG-verified d
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The role uses `ansible.builtin.apt`, so Debian-family hosts only, and needs outbound access to dl.gitea.com for the binary and signature and to `gitea_gpg_key_url` (keys.openpgp.org over HTTPS by default) for the signing key.
|
||||
|
||||
Ubuntu 26.04 (resolute) is not declared yet: the 26.04 molecule image lacks gnupg, which the scenario needs.
|
||||
|
||||
The role targets Ubuntu hosts that serve Gitea, not Proxmox nodes, so it does not cover Debian trixie.
|
||||
|
||||
## Requirements and run order
|
||||
@@ -142,7 +144,7 @@ Update or remove: pass `-e gitea_update=true`, or `-e "gitea_remove=true gitea_r
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs on one platform, Ubuntu 24.04 (noble) (`${MOLECULE_IMAGE}`). It never installs Gitea: converge applies nothing and every check is in `verify.yml` (see `molecule/default`). It covers:
|
||||
The `default` molecule scenario runs in CI only, on one platform: `${MOLECULE_IMAGE}` (Ubuntu 24.04). It never installs Gitea: converge applies nothing and every check is in `verify.yml` (see `molecule/default`). It covers:
|
||||
|
||||
- The guard and no-op paths of the `mint` entry point: the confirm guard, the CI refusal under each of `GITHUB_ACTIONS`, `GITEA_ACTIONS` and `CI`, the no-op when `gitea_api_token` is set, and an empty token treated as missing under `--check`. All but the confirm guard run as child processes with a controlled environment.
|
||||
- The signature check of the download, against local files and throwaway keys: a signature by the pinned key places the binary; a signature by another key, a tampered binary and a key file without the pinned key each fail at the expected task; no download directory is left behind.
|
||||
|
||||
@@ -4,7 +4,7 @@ Installs a Gitea Actions runner (`gitea-runner`) with Docker as a systemd servic
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The role uses `ansible.builtin.apt` and installs `docker.io`, so Debian-family hosts only, and needs outbound access to dl.gitea.com and Docker Hub (the Docker check pulls `ubuntu:24.04`). On an unprivileged LXC host, Docker needs nesting enabled on the container.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The role uses `ansible.builtin.apt` and installs `docker.io`, so Debian-family hosts only, and needs outbound access to dl.gitea.com and Docker Hub (the Docker check pulls `ubuntu:24.04`). On an unprivileged LXC host, Docker needs nesting enabled on the container.
|
||||
|
||||
The role targets Ubuntu hosts that run CI jobs, not Proxmox nodes, so it does not cover Debian trixie.
|
||||
|
||||
@@ -89,7 +89,7 @@ Change the registration scope of a registered runner: set `gitea_runner_registra
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs on one platform, Ubuntu 24.04 (noble) (`${MOLECULE_IMAGE}`), without a Gitea server and without Docker: a stub `docker.service`, a stub runner binary and a seeded `.runner` stand in for them, and the downloads come from local `file://` URLs. It covers the converge with the prune timer and an update through `_binary_update` (and its idempotence), the rendered `config.yaml` and unit, the prune gate script, the count prune and the disk check against a stub `docker` CLI, turning the pressure prune off, a failed checksum that leaves the runner running, the input asserts, the CI refusal of a forced re-registration and the mint-before-drop order, and the remove path. Registration, the Docker install and the host packages of the host-executor label are not covered.
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It runs without a Gitea server and without Docker: a stub `docker.service`, a stub runner binary and a seeded `.runner` stand in for them, and the downloads come from local `file://` URLs. It covers the converge with the prune timer and an update through `_binary_update` (and its idempotence), the rendered `config.yaml` and unit, the prune gate script, the count prune and the disk check against a stub `docker` CLI, turning the pressure prune off, a failed checksum that leaves the runner running, the input asserts, the CI refusal of a forced re-registration and the mint-before-drop order, and the remove path. Registration, the Docker install and the host packages of the host-executor label are not covered.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- gitea
|
||||
- actions
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No Gitea server and no Docker
|
||||
# daemon: prepare.yml seeds a stub docker.service, a stub runner binary that reports an older
|
||||
# version, and a .runner file, so the role skips the Docker install and the registration, and
|
||||
# the update downloads its new stub from local file:// URLs. The scenario downloads nothing.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No Gitea server and no Docker daemon: prepare.yml seeds a stub
|
||||
# docker.service, a stub runner binary that reports an older version, and a .runner file, so the
|
||||
# role skips the Docker install and the registration, and the update downloads its new stub from
|
||||
# local file:// URLs. The scenario downloads nothing.
|
||||
# The container runs systemd as PID 1 with a writable cgroup; no privileged mode.
|
||||
driver:
|
||||
name: docker
|
||||
@@ -23,6 +24,21 @@ platforms:
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-runner-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
# One source for every play, so a verify play that runs the role again renders the same
|
||||
|
||||
@@ -4,9 +4,7 @@ Installs [Pi-hole](https://pi-hole.net) v6 by cloning the upstream repository an
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The role asserts that the host is Ubuntu before any change. The package dependencies come from `ansible.builtin.apt`. The host needs outbound access to the upstream Pi-hole repository (`repo.remote` in the merged settings) and to the apt mirrors.
|
||||
|
||||
Untested platforms: Ubuntu 26.04 (resolute). The apt dependencies exist there, but the scenario does not run on it yet.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The role asserts that the host is Ubuntu before any change. The package dependencies come from `ansible.builtin.apt`. The host needs outbound access to the upstream Pi-hole repository (`repo.remote` in the merged settings) and to the apt mirrors.
|
||||
|
||||
The role targets Ubuntu hosts that serve DNS, not Proxmox nodes, so it does not cover Debian trixie: the upstream installer is run on the Ubuntu hosts it is tested on.
|
||||
|
||||
@@ -60,7 +58,7 @@ The input asserts carry `always` (and `assert`), so they run whatever tags are s
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs on noble. It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a first-run preview) and after the idempotence run. Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password and the placeholder password.
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a first-run preview) and after the idempotence run. Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password and the placeholder password.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- pihole
|
||||
- dns
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). Needs outbound network for the apt packages. The upstream
|
||||
# Pi-hole repository is replaced by a local stub whose installer only logs its arguments
|
||||
# (prepare.yml), so the scenario tests the role's own logic, not Pi-hole itself.
|
||||
# The containers run systemd as PID 1 with a writable cgroup; no privileged mode.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. Needs outbound network for the apt packages. The upstream Pi-hole
|
||||
# repository is replaced by a local stub whose installer only logs its arguments (prepare.yml), so
|
||||
# the scenario tests the role's own logic, not Pi-hole itself. The containers run systemd as PID 1
|
||||
# with a writable cgroup; no privileged mode.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -22,6 +23,21 @@ platforms:
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-pihole-resolute
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
# One source for every play, so the converge and the negative tests in verify.yml start from
|
||||
|
||||
@@ -4,9 +4,9 @@ Writes a hardened sshd drop-in, selected by a profile, and refuses configuration
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on.
|
||||
|
||||
Untested platforms: Ubuntu 22.04 (jammy) and Debian trixie (Proxmox VE 9 nodes, the `pve` profile), listed in `meta/main.yml` but not converged by a test.
|
||||
Untested platforms: Debian trixie (Proxmox VE 9 nodes, the `pve` profile), listed in `meta/main.yml` but not converged by a test.
|
||||
|
||||
The role targets Ubuntu guests (the `ubuntu_lxc` and `ubuntu_vm` profiles) and Proxmox VE nodes (the `pve` profile).
|
||||
|
||||
@@ -59,7 +59,7 @@ The role defines none.
|
||||
|
||||
## Tests
|
||||
|
||||
The scenario `molecule/default/`, run by the Collection's CI, runs on one platform: `${MOLECULE_IMAGE}`, an Ubuntu 24.04 (noble) container that ships openssh-server. The sequence runs converge, idempotence and verify; it has no check-mode step.
|
||||
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). Both images ship openssh-server. The sequence runs converge, idempotence and verify; it has no check-mode step.
|
||||
|
||||
- Converge applies the `ubuntu_lxc` profile. It then loads the defaults through `tasks_from: validate.yml` without changing the host: every profile (`pve`, `ubuntu_lxc`, `ubuntu_vm`) passes validation and keeps its root login policy and key algorithms, a consumer `sshd_settings` override wins over the profile, and the `pve` guard accepts each value that allows root key login.
|
||||
- Verify first checks the refusals: a run without `sshd_profile`, `PubkeyAuthentication no` (lock-out), a `pve` profile with `PermitRootLogin no` or `forced-commands-only`, a `pve` profile without `rsa-sha2-512`, SHA-1 `ssh-rsa`, and an unknown profile. Each but the missing profile is matched on its message.
|
||||
|
||||
@@ -9,8 +9,8 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- jammy
|
||||
- noble
|
||||
- resolute
|
||||
- name: Debian
|
||||
versions:
|
||||
- trixie
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# The production profile: Ubuntu 24.04 LXCs. Only the profile name and the user are supplied.
|
||||
# The production profile: Ubuntu LXCs. Only the profile name and the user are supplied.
|
||||
- name: Converge the role with a valid profile
|
||||
hosts: all
|
||||
vars:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml), which ships openssh-server. No
|
||||
# privileged mode: systemd needs a writable cgroup; NET_ADMIN keeps the container the same as
|
||||
# the other role scenarios.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml; both ship openssh-server. No privileged mode: systemd
|
||||
# needs a writable cgroup; NET_ADMIN keeps the container the same as the other role scenarios.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -23,6 +23,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-sshd-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
|
||||
@@ -237,8 +237,10 @@
|
||||
- name: Root logs in with keys only, passwords stay off
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
# sshd -T prints the first alias in its table for prohibit-password: without-password.
|
||||
- sshd_verify_pve_effective.stdout_lines is contains('permitrootlogin without-password')
|
||||
# sshd -T prints prohibit-password under one of its names, by OpenSSH version.
|
||||
- >-
|
||||
'permitrootlogin prohibit-password' in sshd_verify_pve_effective.stdout_lines
|
||||
or 'permitrootlogin without-password' in sshd_verify_pve_effective.stdout_lines
|
||||
- sshd_verify_pve_effective.stdout_lines is contains('passwordauthentication no')
|
||||
- sshd_verify_pve_effective.stdout_lines is contains('pubkeyauthentication yes')
|
||||
quiet: true
|
||||
|
||||
@@ -4,9 +4,9 @@ Applies an OS baseline chosen by `system_baseline_system_type`: apt upgrade, pac
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble) passes the molecule scenario. The tasks use apt and the reboot check is limited to the Debian family. See `meta/main.yml`.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The tasks use apt and the reboot check is limited to the Debian family. See `meta/main.yml`.
|
||||
|
||||
Untested platforms: Debian 13 (trixie, Proxmox hosts), not verified by a test; Ubuntu 22.04 (jammy), listed in `meta/main.yml` but neither supported nor tested.
|
||||
Untested platforms: Debian 13 (trixie, Proxmox hosts), listed in `meta/main.yml` but not verified by a test.
|
||||
|
||||
The role targets Ubuntu guests (the `ubuntu_lxc` and `ubuntu_vm` profiles) and Proxmox VE hosts on Debian (the `pve` profile).
|
||||
|
||||
@@ -124,7 +124,7 @@ The two task files besides `main` are a supported interface, for a caller that d
|
||||
|
||||
## Tests
|
||||
|
||||
The scenario `molecule/default/` runs in CI only, on one platform: `${MOLECULE_IMAGE}`, an Ubuntu 24.04 (noble) container. It installs packages from the Ubuntu mirrors, so the runner needs outbound network. The sequence runs prepare, converge, idempotence and verify; it has no check-mode step.
|
||||
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It installs packages from the Ubuntu mirrors, so the runner needs outbound network. The sequence runs prepare, converge, idempotence and verify; it has no check-mode step.
|
||||
|
||||
- Converge first checks that the role refuses a bad input with its own message before any change: an unknown `system_baseline_system_type`, an unknown `system_baseline_apt_upgrade` (main flow and `update` entry point), a negative reboot throttle or a negative or boolean post-reboot delay (main flow and `reboot` entry point), a line break in `system_baseline_apt_daily_timeout`, and a bad package blacklist (a quote, a null item, a bare string).
|
||||
- Converge then applies the `ubuntu_lxc` profile, with tmux autostart and `system_baseline_apt_daily_timeout: 1h`, and only resolves the `pve` and `ubuntu_vm` profiles and a consumer override, asserting the resolved inputs.
|
||||
|
||||
@@ -9,8 +9,8 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- jammy
|
||||
- noble
|
||||
- resolute
|
||||
- name: Debian
|
||||
versions:
|
||||
- trixie
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). Unlike the other scenarios
|
||||
# this one installs packages (the role's system_baseline_essential_packages list) from the Ubuntu
|
||||
# mirrors during prepare and converge, so the runner needs outbound network. No
|
||||
# privileged mode: systemd needs a writable cgroup and the firewall tools need
|
||||
# NET_ADMIN, nothing else.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. Unlike the other scenarios this one installs packages (the
|
||||
# role's system_baseline_essential_packages list) from the Ubuntu mirrors during prepare and
|
||||
# converge, so the runner needs outbound network. No privileged mode: systemd needs a writable
|
||||
# cgroup and the firewall tools need NET_ADMIN, nothing else.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -25,6 +25,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-system-baseline-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
options:
|
||||
|
||||
@@ -4,9 +4,9 @@ Disables and masks risky services, writes a systemd manager hardening drop-in an
|
||||
|
||||
## Supported platforms
|
||||
|
||||
The molecule scenario passes on Ubuntu 24.04 (noble); see [Tests](#tests). The role is meant for hosts with systemd: Ubuntu 24.04 (noble) LXCs, Ubuntu VMs and Debian 13 (trixie) Proxmox hosts. The role is applied to the three system types in `systemd_hardening_profiles`: `pve` (Proxmox hosts), `ubuntu_lxc` and `ubuntu_vm`.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on; see [Tests](#tests). The role is meant for hosts with systemd: Ubuntu LXCs, Ubuntu VMs and Debian 13 (trixie) Proxmox hosts. The role is applied to the three system types in `systemd_hardening_profiles`: `pve` (Proxmox hosts), `ubuntu_lxc` and `ubuntu_vm`.
|
||||
|
||||
Untested platforms: Debian 13 (trixie), and Ubuntu 22.04 (jammy), which is listed in `meta/main.yml` but neither supported nor tested.
|
||||
Untested platforms: Debian 13 (trixie), listed in `meta/main.yml` but not verified by a test.
|
||||
|
||||
## Requirements and run order
|
||||
|
||||
@@ -52,7 +52,7 @@ Only `always` (the `systemd_hardening_system_type` assert) works as intended. `d
|
||||
|
||||
## Tests
|
||||
|
||||
`molecule/default` runs in CI only, on one platform: Ubuntu 24.04 (noble), the `molecule-ubuntu2404` image (`${MOLECULE_IMAGE}`). It runs the `ubuntu_lxc` profile against stub unit files (a socket and a service for the ones that ship both, a service only and a socket only for the others), because the test image installs none of the services the role disables or masks. It checks that the stub sockets and services end up stopped and disabled or masked, that a listed unit that does not exist is skipped, the manager and service drop-ins (loaded by systemd after the reload) and the refusals: a missing or unknown `systemd_hardening_system_type`, and a `systemd_hardening_services` entry or value that is not a mapping. It cannot show that a real `rpcbind` or similar stops. The `pve` and `ubuntu_vm` profiles and Debian 13 are not verified by a test.
|
||||
`molecule/default` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It runs the `ubuntu_lxc` profile against stub unit files (a socket and a service for the ones that ship both, a service only and a socket only for the others), because the test images install none of the services the role disables or masks. It checks that the stub sockets and services end up stopped and disabled or masked, that a listed unit that does not exist is skipped, the manager and service drop-ins (loaded by systemd after the reload) and the refusals: a missing or unknown `systemd_hardening_system_type`, and a `systemd_hardening_services` entry or value that is not a mapping. It cannot show that a real `rpcbind` or similar stops. The `pve` and `ubuntu_vm` profiles and Debian 13 are not verified by a test.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- jammy
|
||||
- noble
|
||||
- resolute
|
||||
- name: Debian
|
||||
versions:
|
||||
- trixie
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No privileged mode: systemd needs a
|
||||
# writable cgroup and the firewall tools need NET_ADMIN, nothing else.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup and the
|
||||
# firewall tools need NET_ADMIN, nothing else.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -22,6 +23,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-systemd-hardening-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
|
||||
@@ -4,7 +4,7 @@ Installs the Traefik reverse proxy as a systemd-managed binary, renders its stat
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on. The role uses `ansible.builtin.apt`, so Debian-family hosts only, and needs outbound access to github.com for the release archive and checksum file. Only `traefik_install_type: binary` exists.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on. The role uses `ansible.builtin.apt`, so Debian-family hosts only, and needs outbound access to github.com for the release archive and checksum file. Only `traefik_install_type: binary` exists.
|
||||
|
||||
The role targets Ubuntu hosts that run the reverse proxy, not Proxmox nodes, so it does not cover Debian trixie.
|
||||
|
||||
@@ -79,7 +79,7 @@ Update or remove: pass `-e traefik_update=true`, or `-e "traefik_remove=true tra
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs on one platform, Ubuntu 24.04 (noble) (`${MOLECULE_IMAGE}`). It needs outbound network: the role installs packages with apt and downloads real Traefik releases from GitHub. Converge runs `mortis.kamino.ufw`, then the role. Verify covers:
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It needs outbound network: the role installs packages with apt and downloads real Traefik releases from GitHub. Converge runs `mortis.kamino.ufw`, then the role. Verify covers:
|
||||
|
||||
- The input guards, first: one play expects the failure message containing `unauthenticated Traefik dashboard` (the dashboard guard: enabled without valid `user:hash` users); the next expects `collides with the middleware`, raised by the dashboard-auth collision assert, which runs whenever users are set, also with the dashboard off.
|
||||
- The install: the pinned version runs, and only the binary is left from the archive.
|
||||
|
||||
@@ -10,6 +10,7 @@ galaxy_info:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- traefik
|
||||
- reverseproxy
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). Needs outbound network, unlike most
|
||||
# scenarios: the role installs packages with apt and downloads Traefik releases from GitHub. No
|
||||
# privileged mode: systemd needs a writable cgroup and the firewall tools need NET_ADMIN.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. Needs outbound network, unlike most scenarios: the role installs
|
||||
# packages with apt and downloads Traefik releases from GitHub. No privileged mode: systemd needs a
|
||||
# writable cgroup and the firewall tools need NET_ADMIN.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -23,6 +24,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-traefik-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
# One source for every play in converge.yml and verify.yml. The role renders traefik.yml before
|
||||
|
||||
+2
-4
@@ -4,9 +4,7 @@ Installs UFW and applies sysctl overrides, `/etc/ufw/before.rules`, default poli
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the platform the molecule scenario runs on.
|
||||
|
||||
Untested platforms: Ubuntu 22.04 (jammy), listed in `meta/main.yml` but not verified by a test.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on.
|
||||
|
||||
Ubuntu hosts only: the role firewalls Ubuntu guests; the `pve` profile of `system_baseline` does not install ufw, so Proxmox hosts are not targeted.
|
||||
|
||||
@@ -138,7 +136,7 @@ Skipping `ufw_aggregate` leaves the lists the later tasks read (`ufw_aggregated_
|
||||
|
||||
## Tests
|
||||
|
||||
The scenario `molecule/default/` runs in CI only, on one platform: `${MOLECULE_IMAGE}`, an Ubuntu 24.04 (noble) container with `NET_ADMIN`. The sequence runs prepare, converge, idempotence and verify; it has no check-mode step.
|
||||
The scenario `molecule/default/` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). Both containers get `NET_ADMIN`. The sequence runs prepare, converge, idempotence and verify; it has no check-mode step.
|
||||
|
||||
- Prepare installs ufw and stores rules the role must handle: an untagged manual rule, a manual rule the base list deletes, and tagged rules of service owners that are stale, removed or orphaned, some of them looking like an SSH path (port 22 with a source, no port, a range, an application profile named like SSH).
|
||||
- Converge applies the base `ufw_rules` (one entry with `delete: true`), then calls `service_rules` for several owners (purge on, purge off, `absent`), and `orphan_rules` with no list, an empty list, report only and purge.
|
||||
|
||||
@@ -9,8 +9,8 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- jammy
|
||||
- noble
|
||||
- resolute
|
||||
galaxy_tags:
|
||||
- firewall
|
||||
- ufw
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No privileged mode: systemd needs a
|
||||
# writable cgroup and the firewall tools need NET_ADMIN, nothing else.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup and the
|
||||
# firewall tools need NET_ADMIN, nothing else.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -22,6 +23,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-ufw-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
|
||||
@@ -4,9 +4,9 @@ Manages the primary ansible user and additional users, their `authorized_keys`,
|
||||
|
||||
## Supported platforms
|
||||
|
||||
Ubuntu 24.04 (noble), the only platform converged by a test (see [Tests](#tests)). The role installs sudo with apt.
|
||||
Ubuntu 24.04 (noble) and 26.04 (resolute), the platforms the molecule scenario runs on (see [Tests](#tests)). The role installs sudo with apt.
|
||||
|
||||
Untested platforms: Ubuntu 22.04 (jammy) and Debian trixie (Proxmox VE nodes), listed in `meta/main.yml`.
|
||||
Untested platforms: Debian trixie (Proxmox VE nodes), listed in `meta/main.yml`.
|
||||
|
||||
## Requirements and run order
|
||||
|
||||
@@ -64,7 +64,7 @@ Both are set under the `always` tag.
|
||||
|
||||
## Tests
|
||||
|
||||
`molecule/default` runs in the Collection's CI, on one platform: Ubuntu 24.04 (noble), the `molecule-ubuntu2404` image (`${MOLECULE_IMAGE}`). Prepare creates a stale user to remove, plants an extra key in an existing user's `authorized_keys` for authoritative mode to drop, and sets root's password before converge; the role then locks it. The converge sets the primary user explicitly instead of through the `{{ ansible_user }}` default.
|
||||
`molecule/default` runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). Prepare creates a stale user to remove, plants an extra key in an existing user's `authorized_keys` for authoritative mode to drop, and sets root's password before converge; the role then locks it. The converge sets the primary user explicitly instead of through the `{{ ansible_user }}` default.
|
||||
|
||||
Verify checks:
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ galaxy_info:
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- jammy
|
||||
- noble
|
||||
- resolute
|
||||
- name: Debian
|
||||
versions:
|
||||
- trixie
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404 image
|
||||
# (MOLECULE_IMAGE, the pin in .gitea/workflows/molecule.yml). No privileged mode: systemd needs a
|
||||
# writable cgroup; NET_ADMIN keeps the container the same as the other role scenarios.
|
||||
# Runs on the repository's own runner (label kamino-molecule), in the molecule-ubuntu2404
|
||||
# (MOLECULE_IMAGE) and molecule-ubuntu2604 (MOLECULE_IMAGE_2604) images, pinned in
|
||||
# .gitea/workflows/molecule.yml. No privileged mode: systemd needs a writable cgroup; NET_ADMIN
|
||||
# keeps the container the same as the other role scenarios.
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
@@ -22,6 +23,23 @@ platforms:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
- name: ${KAMINO_RUN_ID:-local}-user-management-2604-instance
|
||||
labels:
|
||||
net.rkdr.mortis.molecule-run: "${KAMINO_RUN_ID:-local}"
|
||||
image: ${MOLECULE_IMAGE_2604}
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
provisioner:
|
||||
name: ansible
|
||||
inventory:
|
||||
|
||||
Reference in new issue
Block a user