From 288cea47a9dc87bbec754a4c6b0301ea0f2a3566 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 21:24:28 +0000 Subject: [PATCH 1/4] docs(adr): record self-built CI and molecule images, versioned by CI, pinned by version and digest ADR 0002 records the decision with its measured saving and build cost. The two risks it leaves (no Molecule run after a merge, and pin bumps first behaviour-tested after they merge) go to the Accepted risks register in SECURITY.md, as docs/adr/AGENTS.md requires. Closes #167 Assisted-by: Claude Code --- SECURITY.md | 23 +++++++++ .../0002-self-built-ci-and-molecule-images.md | 51 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/adr/0002-self-built-ci-and-molecule-images.md diff --git a/SECURITY.md b/SECURITY.md index b3eba0b..5a3373e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -98,3 +98,26 @@ reduction. A later decision that accepts a risk adds an entry here. already reaches every secret. There is no `renovate/*` push allowlist. - **Trigger:** a token that can push here but cannot reach the secrets. - **Planned reduction:** none for now. + +### No Molecule run after a merge + +- **Risk:** Molecule does not run on push to `main` + ([ADR 0002](docs/adr/0002-self-built-ci-and-molecule-images.md)). Only the nightly full run + catches drift outside the tree (mirrors, images) or a scenario-selection mistake, and it is + the only run of the scenarios a pull request's diff did not select. +- **Why accepted:** "block on outdated branch" is on, so `main` only ever receives the tree its + pull request tested; no Molecule run on `main` has failed after its pull request passed. +- **Trigger:** a nightly run fails on a tree whose pull request passed. +- **Planned reduction:** none for now. + +### Pin bumps first behaviour-tested after they merge + +- **Risk:** Lint, Build and Molecule install a pull request's pins when they differ from the + image, so an image-input pull request is tested on its own pins. But a pin bump that selects + no Molecule scenario (every Python pin except an ansible-core minor bump, which edits + `meta/runtime.yml`) is first behaviour-tested by the `ci` pin pull request, after it has + merged. +- **Why accepted:** the `ci` pin pull request runs every scenario before the new image is used, + and running every scenario on every Python pin bump would cost about 10 minutes each. +- **Trigger:** a `ci` pin pull request fails Molecule because of a bumped pin. +- **Planned reduction:** none for now. diff --git a/docs/adr/0002-self-built-ci-and-molecule-images.md b/docs/adr/0002-self-built-ci-and-molecule-images.md new file mode 100644 index 0000000..0f5be4e --- /dev/null +++ b/docs/adr/0002-self-built-ci-and-molecule-images.md @@ -0,0 +1,51 @@ +# 0002. Self-built CI and molecule images, versioned by CI, pinned by version and digest + +Status: accepted + +## Context + +Every CI job runs on one shared runner. Installing the toolchain in each job is simple but slow: +Lint took about 82s and Build about 50s that way. Building our own images is faster but adds +machinery: Dockerfiles, an image build, version tags and pin updates. The choice is hard to undo +once every workflow pins an image. + +## Decision + +- **We build our own images:** a `ci` image, and one Dockerfile per molecule image (one per Ubuntu + release, and later the Debian 13 one). +- **The molecule images bake in everything except what a role installs itself.** The test + fixtures a scenario's `prepare.yml` needs are baked in. Packages a role installs are still + downloaded, because that install path is what the test exercises. A converge is not kept off + the network. +- **Consumers pin `@sha256:`.** +- **CI assigns the patch version from the image's inputs.** A published tag is never moved. +- **The pin follows each build through Renovate.** +- **Molecule runs are isolated per run:** per-run container names and labels, and no shared + concurrency group. Molecule does not run on push to `main`. Raising the runner's capacity is a + separate change. + +## Reason + +We chose speed over simplicity, and the measured saving shows the trade: + +- Lint takes about 33s with the image instead of about 82s, and Build about 13s instead of about + 50s (measured 3 to 17 November 2026; an earlier measurement gave 15–25s for Lint and 10–25s for + Build). +- The cost: a `ci` image build takes about 4 minutes on the shared runner, and each new version + also costs a pin pull request's CI. `ci` went from 0.1.0 to 0.2.23 in three weeks, with 9 + versions on 14–15 November. + +Versions are assigned by CI, because a version a person has to remember to raise is one +somebody forgets. Pinning by digest means a consumer runs exactly the image a reviewer saw. + +Molecule runs are isolated per run rather than queued in one concurrency group, because a +shared group cancels a waiting run and stalls the required check of that run's pull request. + +The risks this leaves are in the [Accepted risks](../../SECURITY.md#accepted-risks) register: +no Molecule run after a merge, and pin bumps that are first behaviour-tested after they merge. + +## Not done + +- **One molecule Dockerfile with a release build argument:** it would need a matrix argument, a + Renovate regex manager for two digests and a pins check that reads build arguments. It would + save one file that review keeps in step anyway. From 2b1301d8381010195678a223cbd9744b7678d009 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 21:26:34 +0000 Subject: [PATCH 2/4] docs(adr): date each measurement and give the recorded Dockerfile reason Assisted-by: Claude Code --- SECURITY.md | 13 +++++++------ .../0002-self-built-ci-and-molecule-images.md | 16 +++++++--------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 5a3373e..54e6dc2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -113,11 +113,12 @@ reduction. A later decision that accepts a risk adds an entry here. ### Pin bumps first behaviour-tested after they merge - **Risk:** Lint, Build and Molecule install a pull request's pins when they differ from the - image, so an image-input pull request is tested on its own pins. But a pin bump that selects - no Molecule scenario (every Python pin except an ansible-core minor bump, which edits - `meta/runtime.yml`) is first behaviour-tested by the `ci` pin pull request, after it has - merged. -- **Why accepted:** the `ci` pin pull request runs every scenario before the new image is used, + image, so a pull request that changes an image input is tested on its own pins. But most pin + bumps select no Molecule scenario: every Python pin except an ansible-core minor bump, which + edits `meta/runtime.yml`. Such a bump is first behaviour-tested after it has merged, by the + pull request that moves the workflows to the new `ci` image. +- **Why accepted:** that pull request runs every scenario before the new image is used, and running every scenario on every Python pin bump would cost about 10 minutes each. -- **Trigger:** a `ci` pin pull request fails Molecule because of a bumped pin. +- **Trigger:** the pull request that moves the workflows to a new `ci` image fails Molecule + because of a bumped pin. - **Planned reduction:** none for now. diff --git a/docs/adr/0002-self-built-ci-and-molecule-images.md b/docs/adr/0002-self-built-ci-and-molecule-images.md index 0f5be4e..f208c4a 100644 --- a/docs/adr/0002-self-built-ci-and-molecule-images.md +++ b/docs/adr/0002-self-built-ci-and-molecule-images.md @@ -4,10 +4,9 @@ Status: accepted ## Context -Every CI job runs on one shared runner. Installing the toolchain in each job is simple but slow: -Lint took about 82s and Build about 50s that way. Building our own images is faster but adds -machinery: Dockerfiles, an image build, version tags and pin updates. The choice is hard to undo -once every workflow pins an image. +Every CI job runs on one shared runner. Installing the toolchain in each job is simple but slow. +Building our own images is faster but adds machinery: Dockerfiles, an image build, version tags +and pin updates. The choice is hard to undo once every workflow pins an image. ## Decision @@ -28,9 +27,8 @@ once every workflow pins an image. We chose speed over simplicity, and the measured saving shows the trade: -- Lint takes about 33s with the image instead of about 82s, and Build about 13s instead of about - 50s (measured 3 to 17 November 2026; an earlier measurement gave 15–25s for Lint and 10–25s for - Build). +- With everything installed per run, Lint took about 82s and Build about 50s (24–25 October + 2026). With the image, Lint takes about 33s and Build about 13s (3 to 17 November 2026). - The cost: a `ci` image build takes about 4 minutes on the shared runner, and each new version also costs a pin pull request's CI. `ci` went from 0.1.0 to 0.2.23 in three weeks, with 9 versions on 14–15 November. @@ -47,5 +45,5 @@ no Molecule run after a merge, and pin bumps that are first behaviour-tested aft ## Not done - **One molecule Dockerfile with a release build argument:** it would need a matrix argument, a - Renovate regex manager for two digests and a pins check that reads build arguments. It would - save one file that review keeps in step anyway. + Renovate regex manager for two digests and a pins check that reads build arguments, and the + Debian 13 image differs by more than a release tag anyway. Review keeps the files in step. From 87280a2f601df9ec47ab5b2cdfeea28e13a2e2e6 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 21:27:39 +0000 Subject: [PATCH 3/4] docs(security): date the no-failure evidence of the post-merge entry Assisted-by: Claude Code --- SECURITY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 54e6dc2..56aad7a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -106,7 +106,8 @@ reduction. A later decision that accepts a risk adds an entry here. catches drift outside the tree (mirrors, images) or a scenario-selection mistake, and it is the only run of the scenarios a pull request's diff did not select. - **Why accepted:** "block on outdated branch" is on, so `main` only ever receives the tree its - pull request tested; no Molecule run on `main` has failed after its pull request passed. + pull request tested; no Molecule run on `main` failed after its pull request passed (3 to 17 + November 2026). - **Trigger:** a nightly run fails on a tree whose pull request passed. - **Planned reduction:** none for now. From a659e83e6b6ee5ea059fe590f3892678765b8917 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 26 Nov 2026 21:56:10 +0000 Subject: [PATCH 4/4] chore(release): 3.1.0 Minor release: adds the tailscale role, and fixes six roles that failed under --check on a host where they were not installed yet. Assisted-by: Claude Code:claude-opus-5-5 --- CHANGELOG.rst | 18 ++++++++++++++++ README.md | 4 ++-- changelogs/.plugin-cache.yaml | 6 +++++- changelogs/changelog.yaml | 28 +++++++++++++++++++++++++ changelogs/fragments/134-check-mode.yml | 17 --------------- changelogs/fragments/tailscale-role.yml | 9 -------- galaxy.yml | 2 +- 7 files changed, 54 insertions(+), 30 deletions(-) delete mode 100644 changelogs/fragments/134-check-mode.yml delete mode 100644 changelogs/fragments/tailscale-role.yml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5e714a7..c20337f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,24 @@ mortis.kamino Release Notes .. contents:: Topics +v3.1.0 +====== + +Minor Changes +------------- + +- tailscale - New role. Installs Tailscale from the upstream APT repository with the keyring pinned by sha256, sets ``--tun=userspace-networking`` in the ``tailscaled`` flags when ``tailscale_userspace_networking`` is true, enables ``tailscaled`` and, with ``tailscale_up`` (default ``true``), runs ``tailscale up`` with ``tailscale_auth_key`` while the node is not Running; it can also update to the APT candidate version and remove or purge. Declares Ubuntu noble and resolute; the molecule scenario installs the real package but does not join a tailnet. + +Bugfixes +-------- + +- cloudflared - Do not fail under ``--check`` on a host where the cloudflared account or systemd unit does not exist yet. +- docker - Do not fail under ``--check`` on a host where the Docker repository and packages are not installed yet. +- gitea - Do not fail under ``--check`` on a host where Gitea is not installed yet. +- gitea_runner - Do not fail under ``--check`` on a host where the runner account, Docker or the systemd unit does not exist yet. +- traefik - Do not fail under ``--check`` on a host where Traefik is not installed yet. +- user_management - Do not fail under ``--check`` when a managed user does not exist yet. + v3.0.0 ====== diff --git a/README.md b/README.md index ee00e4d..b2f970d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ An Ansible Collection of reusable, hardened roles for a self-hosted home lab: `pihole`, `pve_lxc`, `sshd`, `system_baseline`, `systemd_hardening`, `tailscale`, `traefik`, `ufw` and `user_management`, plus the internal `_binary_update`. Roles still to come are listed under [Roadmap](#roadmap). -Status: roles arrive in waves. Release 3.0.0 holds the `cloudflared`, `docker`, `fail2ban`, `gitea`, `gitea_runner`, `network_interfaces`, `pihole`, `pve_lxc`, `sshd`, `system_baseline`, `systemd_hardening`, `traefik`, `ufw` and `user_management` roles (and the internal `_binary_update`, which `cloudflared`, `gitea`, `gitea_runner` and `traefik` call). +Status: roles arrive in waves. Release 3.1.0 holds the `cloudflared`, `docker`, `fail2ban`, `gitea`, `gitea_runner`, `network_interfaces`, `pihole`, `pve_lxc`, `sshd`, `system_baseline`, `systemd_hardening`, `tailscale`, `traefik`, `ufw` and `user_management` roles (and the internal `_binary_update`, which `cloudflared`, `gitea`, `gitea_runner` and `traefik` call). ## Consuming @@ -17,7 +17,7 @@ name (FQCN) only, `mortis.kamino.`: collections: - name: https://git.rkdr.net/mortis/kamino.git type: git - version: v3.0.0 + version: v3.1.0 ``` Its dependencies (`community.general`, `ansible.posix`, `community.proxmox`) are declared in `galaxy.yml`, so diff --git a/changelogs/.plugin-cache.yaml b/changelogs/.plugin-cache.yaml index 8b38374..8d3c40a 100644 --- a/changelogs/.plugin-cache.yaml +++ b/changelogs/.plugin-cache.yaml @@ -51,6 +51,10 @@ objects: description: Harden systemd for a system type name: systemd_hardening version_added: null + tailscale: + description: Install Tailscale and bring the node up + name: tailscale + version_added: null traefik: description: Install, configure, update or remove Traefik as a systemd binary name: traefik @@ -81,4 +85,4 @@ plugins: strategy: {} test: {} vars: {} -version: 3.0.0 +version: 3.1.0 diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 0b22a3c..8e11d64 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -446,3 +446,31 @@ releases: - 133-drop-jammy-and-ubuntu-all.yml - 133-ubuntu-2604.yml release_date: '2026-11-26' + 3.1.0: + changes: + bugfixes: + - cloudflared - Do not fail under ``--check`` on a host where the cloudflared + account or systemd unit does not exist yet. + - docker - Do not fail under ``--check`` on a host where the Docker repository + and packages are not installed yet. + - gitea - Do not fail under ``--check`` on a host where Gitea is not installed + yet. + - gitea_runner - Do not fail under ``--check`` on a host where the runner account, + Docker or the systemd unit does not exist yet. + - traefik - Do not fail under ``--check`` on a host where Traefik is not installed + yet. + - user_management - Do not fail under ``--check`` when a managed user does not + exist yet. + minor_changes: + - tailscale - New role. Installs Tailscale from the upstream APT repository + with the keyring pinned by sha256, sets ``--tun=userspace-networking`` in + the ``tailscaled`` flags when ``tailscale_userspace_networking`` is true, + enables ``tailscaled`` and, with ``tailscale_up`` (default ``true``), runs + ``tailscale up`` with ``tailscale_auth_key`` while the node is not Running; + it can also update to the APT candidate version and remove or purge. Declares + Ubuntu noble and resolute; the molecule scenario installs the real package + but does not join a tailnet. + fragments: + - 134-check-mode.yml + - tailscale-role.yml + release_date: '2026-11-26' diff --git a/changelogs/fragments/134-check-mode.yml b/changelogs/fragments/134-check-mode.yml deleted file mode 100644 index b10398a..0000000 --- a/changelogs/fragments/134-check-mode.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -bugfixes: - - >- - cloudflared - Do not fail under ``--check`` on a host where the cloudflared account or systemd - unit does not exist yet. - - >- - docker - Do not fail under ``--check`` on a host where the Docker repository and packages are - not installed yet. - - >- - gitea - Do not fail under ``--check`` on a host where Gitea is not installed yet. - - >- - gitea_runner - Do not fail under ``--check`` on a host where the runner account, Docker or the - systemd unit does not exist yet. - - >- - traefik - Do not fail under ``--check`` on a host where Traefik is not installed yet. - - >- - user_management - Do not fail under ``--check`` when a managed user does not exist yet. diff --git a/changelogs/fragments/tailscale-role.yml b/changelogs/fragments/tailscale-role.yml deleted file mode 100644 index 64f1bed..0000000 --- a/changelogs/fragments/tailscale-role.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -minor_changes: - - >- - tailscale - New role. Installs Tailscale from the upstream APT repository with the keyring pinned by sha256, - sets ``--tun=userspace-networking`` in the ``tailscaled`` flags when ``tailscale_userspace_networking`` is true, - enables ``tailscaled`` and, with ``tailscale_up`` (default ``true``), runs ``tailscale up`` with - ``tailscale_auth_key`` while the node is not Running; it can also update to the APT candidate version and remove - or purge. Declares Ubuntu noble and resolute; the molecule scenario installs the real package but does not join a - tailnet. diff --git a/galaxy.yml b/galaxy.yml index fd5c00c..f930b4d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: mortis name: kamino -version: 3.0.0 +version: 3.1.0 readme: README.md authors: - Defame1297