docker_apt_arch defaulted to amd64, so on an arm64 Ubuntu host that was not overridden the apt source said arch=amd64 and apt found no Docker packages. The default is now empty, which derives the architecture from the host: x86_64 gives amd64, aarch64 gives arm64. A value set in the inventory is always used, so nothing changes for a consumer who already sets it.
The two questions the issue left open, answered as proposed (please confirm): derive it from the fact as the default, and fail for any other architecture instead of falling back to amd64. The failure message names docker_apt_arch and says to set it (for example armhf). The value is written into the one-line apt source, so it must be lowercase letters and digits; a space or a bracket is refused before anything changes.
Layout follows roles/AGENTS.md: the lookup table is a constant in vars/main.yml (__docker_arch_by_fact), the resolution and the check are in a new tasks/validate.yml imported first (tags: always), and install.yml reads __docker_apt_arch. A removal (docker_remove) skips the validation, since it does not write the source.
Behaviour change: a host with an architecture other than x86_64 or aarch64 that relied on the amd64 default now fails with a clear message instead of getting an amd64 source line apt cannot use.
Verified
The resolution and the check, with Ansible's own engine, ten cases: x86_64 gives amd64, aarch64 gives arm64, an explicit amd64 on aarch64 wins, an explicit armhf on an unknown ARM host is used; armv7l and riscv64 without an override, a missing architecture fact, bad arch, amd64] and AMD64 are refused, each with a message that names docker_apt_arch.
An independent review of the diff, no blocking finding; it also ran the role with gather_facts: false and with the docker_remove flow, and its wording findings are applied.
Molecule additions: a refusal play for a bad docker_apt_arch; the existing verify assertion arch=amd64 now exercises the derived default on the x86_64 container.
Not verified
Molecule itself (CI only), and any architecture other than x86_64 in it: the container is x86_64, so the arm64 mapping and the unsupported-architecture failure are covered by my local engine tests but not by CI.
The role on a real arm64 host.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #300
`docker_apt_arch` defaulted to `amd64`, so on an arm64 Ubuntu host that was not overridden the apt source said `arch=amd64` and apt found no Docker packages. The default is now empty, which derives the architecture from the host: `x86_64` gives `amd64`, `aarch64` gives `arm64`. A value set in the inventory is always used, so nothing changes for a consumer who already sets it.
The two questions the issue left open, answered as proposed (please confirm): derive it from the fact as the default, and fail for any other architecture instead of falling back to `amd64`. The failure message names `docker_apt_arch` and says to set it (for example `armhf`). The value is written into the one-line apt source, so it must be lowercase letters and digits; a space or a bracket is refused before anything changes.
Layout follows `roles/AGENTS.md`: the lookup table is a constant in `vars/main.yml` (`__docker_arch_by_fact`), the resolution and the check are in a new `tasks/validate.yml` imported first (`tags: always`), and `install.yml` reads `__docker_apt_arch`. A removal (`docker_remove`) skips the validation, since it does not write the source.
**Behaviour change:** a host with an architecture other than `x86_64` or `aarch64` that relied on the `amd64` default now fails with a clear message instead of getting an `amd64` source line apt cannot use.
## Verified
- The resolution and the check, with Ansible's own engine, ten cases: `x86_64` gives `amd64`, `aarch64` gives `arm64`, an explicit `amd64` on `aarch64` wins, an explicit `armhf` on an unknown ARM host is used; `armv7l` and `riscv64` without an override, a missing architecture fact, `bad arch`, `amd64]` and `AMD64` are refused, each with a message that names `docker_apt_arch`.
- All commit-stage hooks pass (yamllint, ansible-lint, REUSE, changelog lint, Conventional Commit).
- An independent review of the diff, no blocking finding; it also ran the role with `gather_facts: false` and with the `docker_remove` flow, and its wording findings are applied.
- Molecule additions: a refusal play for a bad `docker_apt_arch`; the existing verify assertion `arch=amd64` now exercises the derived default on the x86_64 container.
## Not verified
- Molecule itself (CI only), and any architecture other than `x86_64` in it: the container is x86_64, so the `arm64` mapping and the unsupported-architecture failure are covered by my local engine tests but not by CI.
- The role on a real arm64 host.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code
docker_apt_arch defaults to empty, which derives amd64 or arm64 from
the host architecture; another architecture fails the play, and a set
value is always used.
Assisted-by: Claude Code
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #300
docker_apt_archdefaulted toamd64, so on an arm64 Ubuntu host that was not overridden the apt source saidarch=amd64and apt found no Docker packages. The default is now empty, which derives the architecture from the host:x86_64givesamd64,aarch64givesarm64. A value set in the inventory is always used, so nothing changes for a consumer who already sets it.The two questions the issue left open, answered as proposed (please confirm): derive it from the fact as the default, and fail for any other architecture instead of falling back to
amd64. The failure message namesdocker_apt_archand says to set it (for examplearmhf). The value is written into the one-line apt source, so it must be lowercase letters and digits; a space or a bracket is refused before anything changes.Layout follows
roles/AGENTS.md: the lookup table is a constant invars/main.yml(__docker_arch_by_fact), the resolution and the check are in a newtasks/validate.ymlimported first (tags: always), andinstall.ymlreads__docker_apt_arch. A removal (docker_remove) skips the validation, since it does not write the source.Behaviour change: a host with an architecture other than
x86_64oraarch64that relied on theamd64default now fails with a clear message instead of getting anamd64source line apt cannot use.Verified
x86_64givesamd64,aarch64givesarm64, an explicitamd64onaarch64wins, an explicitarmhfon an unknown ARM host is used;armv7landriscv64without an override, a missing architecture fact,bad arch,amd64]andAMD64are refused, each with a message that namesdocker_apt_arch.gather_facts: falseand with thedocker_removeflow, and its wording findings are applied.docker_apt_arch; the existing verify assertionarch=amd64now exercises the derived default on the x86_64 container.Not verified
x86_64in it: the container is x86_64, so thearm64mapping and the unsupported-architecture failure are covered by my local engine tests but not by CI.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code