From a185a301dbf2044a40cbe9936bef9518e1d8ade5 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Fri, 27 Nov 2026 22:25:00 +0000 Subject: [PATCH] docs(docker): say the keyring checksum follows an overridden key URL Set docker_keyring_checksum together with docker_gpg_url, and state that the checksum is the hex digest without the sha256: prefix. Assisted-by: Claude Code --- changelogs/fragments/448-docker-keyring-checksum.yml | 1 + roles/docker/README.md | 2 +- roles/docker/meta/argument_specs.yml | 5 +++-- roles/docker/molecule/default/verify.yml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/448-docker-keyring-checksum.yml b/changelogs/fragments/448-docker-keyring-checksum.yml index e8ca1b2..2d740cb 100644 --- a/changelogs/fragments/448-docker-keyring-checksum.yml +++ b/changelogs/fragments/448-docker-keyring-checksum.yml @@ -3,3 +3,4 @@ minor_changes: - >- docker - New input ``docker_keyring_checksum``: the Docker APT key is verified against a pinned sha256, and a changed key fails the install until a person has checked it and updated the hash. + Set ``docker_keyring_checksum`` too when ``docker_gpg_url`` is overridden. diff --git a/roles/docker/README.md b/roles/docker/README.md index ca7a400..a5e9c35 100644 --- a/roles/docker/README.md +++ b/roles/docker/README.md @@ -27,7 +27,7 @@ The role targets Ubuntu hosts only: it installs from Docker's Ubuntu repository, | `docker_keyring_path` | `/etc/apt/keyrings/docker.asc` | no | Repository key location. | | `docker_apt_list_path` | `/etc/apt/sources.list.d/docker.list` | no | APT source file. | | `docker_gpg_url` | `https://download.docker.com/linux/ubuntu/gpg` | no | Key URL. | -| `docker_keyring_checksum` | sha256 of the current Docker key | no | Expected sha256 of the key at `docker_gpg_url`; a mismatch fails the download, so a changed key stops the install until this is updated. | +| `docker_keyring_checksum` | sha256 of the current Docker key | no | Expected sha256 (hex, no `sha256:` prefix) of the key at `docker_gpg_url`; set it too when `docker_gpg_url` is overridden; a mismatch fails the download, so a changed key stops the install until this is updated. | | `docker_repo_base_url` | `https://download.docker.com/linux/ubuntu` | no | Repository base URL. | | `docker_apt_arch` | derived from the host | no | Architecture in the APT source. Empty derives it (`x86_64` gives `amd64`, `aarch64` gives `arm64`); another architecture fails until this is set. A value set here is always used; lowercase letters and digits only. | | `docker_start_missed` | `false` | no | Install a boot unit that starts the containers Docker skipped after a reboot (see [Boot and shutdown units](#boot-and-shutdown-units)). | diff --git a/roles/docker/meta/argument_specs.yml b/roles/docker/meta/argument_specs.yml index d367813..be1f863 100644 --- a/roles/docker/meta/argument_specs.yml +++ b/roles/docker/meta/argument_specs.yml @@ -54,8 +54,9 @@ argument_specs: default: 1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570 description: - >- - sha256 (hex) of the key at C(docker_gpg_url). The download fails on a mismatch, so a rotated or re-armored - upstream key stops the install until the new key is checked and the hash updated. + sha256 of the key at C(docker_gpg_url), as the hex digest without the C(sha256:) prefix. The download fails + on a mismatch, so a rotated or re-armored upstream key stops the install until the new key is checked and + the hash updated. Set C(docker_keyring_checksum) too when C(docker_gpg_url) is overridden. docker_repo_base_url: type: str default: https://download.docker.com/linux/ubuntu diff --git a/roles/docker/molecule/default/verify.yml b/roles/docker/molecule/default/verify.yml index c9b8de1..aead9c4 100644 --- a/roles/docker/molecule/default/verify.yml +++ b/roles/docker/molecule/default/verify.yml @@ -434,7 +434,7 @@ - (docker_verify_daemon_after.content | b64decode | from_json)['max-concurrent-downloads'] == 6 quiet: true -# A key that does not match docker_keyring_checksum fails its download before the source line is touched. It goes to a separate path, so +# A key that does not match docker_keyring_checksum fails at the key download, so the source line and packages are untouched. It goes to a separate path, so # the installed key stays for the removal below. - name: A key that does not match the pinned checksum is refused hosts: all