From db4ba8d5c87cc51c936dcfce59816604cc481816 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sat, 14 Nov 2026 12:47:37 +0000 Subject: [PATCH] ci(molecule): use molecule-ubuntu2404 0.1.6 and drop the docker prepare gnupg task Moves the MOLECULE_IMAGE pin to 0.1.6, the build of #119 that carries gnupg, and with it: - removes the gnupg install (and its apt update) from the docker scenario's prepare, about 10 s of its 12 s; the role refreshes its own apt cache at install, so nothing relied on that update; - adds gnupg to the image-smoke contract, so the image keeps providing it; - drops gnupg from the docker README's list of what the scenario needs the Ubuntu mirrors for, with a trivial changelog fragment. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG --- .gitea/workflows/molecule.yml | 2 +- changelogs/fragments/molecule-docker-gnupg.yml | 3 +++ extensions/molecule/image-smoke/verify.yml | 1 + roles/docker/README.md | 2 +- roles/docker/molecule/default/prepare.yml | 11 +++-------- 5 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/molecule-docker-gnupg.yml diff --git a/.gitea/workflows/molecule.yml b/.gitea/workflows/molecule.yml index 7a69038..e052fd5 100644 --- a/.gitea/workflows/molecule.yml +++ b/.gitea/workflows/molecule.yml @@ -74,7 +74,7 @@ jobs: # Used by the scenarios as `image: ${MOLECULE_IMAGE}`; set it the same way to run # one locally. MOLECULE_IMAGE: >- - git.rkdr.net/mortis/molecule-ubuntu2404:0.1.5@sha256:57123de013ad0ca0c4c64723f7f86636de07a1d6a40a7bc4f064ec664cd463f9 + git.rkdr.net/mortis/molecule-ubuntu2404:0.1.6@sha256:f1bf4d208aa8f1626f797348a120541af3d4445cb2da0b948d94425df1741909 # The same for Ubuntu 26.04, the release the hosts are moving to; used by # `image: ${MOLECULE_IMAGE_2604}` in extensions/molecule/image-smoke-2604. MOLECULE_IMAGE_2604: >- diff --git a/changelogs/fragments/molecule-docker-gnupg.yml b/changelogs/fragments/molecule-docker-gnupg.yml new file mode 100644 index 0000000..514d1f6 --- /dev/null +++ b/changelogs/fragments/molecule-docker-gnupg.yml @@ -0,0 +1,3 @@ +--- +trivial: + - docker - the molecule scenario takes gnupg from the molecule image, so the README no longer lists it among what the scenario needs the Ubuntu mirrors for. diff --git a/extensions/molecule/image-smoke/verify.yml b/extensions/molecule/image-smoke/verify.yml index a681482..b9d627f 100644 --- a/extensions/molecule/image-smoke/verify.yml +++ b/extensions/molecule/image-smoke/verify.yml @@ -33,6 +33,7 @@ - ufw - fail2ban - openssh-server + - gnupg - name: Query the units a role scenario relies on ansible.builtin.systemd: diff --git a/roles/docker/README.md b/roles/docker/README.md index e89e011..447c5f5 100644 --- a/roles/docker/README.md +++ b/roles/docker/README.md @@ -59,7 +59,7 @@ What it shows, with the role's tasks running unchanged: - The argument check refuses a mapping for `docker_users` and a non-boolean `docker_remove`. - A second run changes nothing (molecule's idempotence check). -What it does not show: that the upstream repository and key at `download.docker.com` are reachable and valid, that the real packages install, that `dockerd` starts, anything about container networking or iptables, the `docker_update` path (`tasks/update.yml`), and removal without `docker_remove_data` (the removal stops the unit first, so it can run only once per install). It needs the Ubuntu mirrors, for `gnupg` in `prepare.yml` and the `curl` the role installs. These gaps are a known residual risk of the role. +What it does not show: that the upstream repository and key at `download.docker.com` are reachable and valid, that the real packages install, that `dockerd` starts, anything about container networking or iptables, the `docker_update` path (`tasks/update.yml`), and removal without `docker_remove_data` (the removal stops the unit first, so it can run only once per install). It needs the Ubuntu mirrors, for the `curl` the role installs. These gaps are a known residual risk of the role. ## Notes diff --git a/roles/docker/molecule/default/prepare.yml b/roles/docker/molecule/default/prepare.yml index e051a8f..6544441 100644 --- a/roles/docker/molecule/default/prepare.yml +++ b/roles/docker/molecule/default/prepare.yml @@ -3,20 +3,15 @@ # bridge, iptables and a delegated cgroup), so the role installs stand-in packages from a # local APT repository. The repository is built and signed here, with a throwaway key, so the # role's own tasks run unchanged: fetch the key, write the source line, install, enable and -# start the unit, join the group. Like the pihole and system_baseline scenarios, this needs -# the Ubuntu mirrors for gnupg and for the curl the role installs. +# start the unit, join the group. gnupg, which signs the repository, is part of the molecule +# image. Like the pihole and system_baseline scenarios, this needs the Ubuntu mirrors for the +# curl the role installs. - name: Prepare hosts: all vars: docker_molecule_repo: /srv/docker-stub-repo docker_molecule_work: /var/tmp/docker-stub-work tasks: - - name: Install gnupg, which signs the stand-in repository - ansible.builtin.apt: - name: gnupg - state: present - update_cache: true - - name: Copy the repository builder ansible.builtin.copy: src: build-stub-repo.sh -- 2.43.0