feat(docker): choose the apt architecture from the host instead of defaulting to amd64 #300

Closed
opened 2026-11-22 20:30:51 +00:00 by Dragonish · 0 comments
Collaborator

Problem

docker_apt_arch defaults to amd64, and the README says to override it per host on anything else. On an arm64 Ubuntu host (for example a Raspberry Pi) that has not been overridden, the source line is written as deb [arch=amd64 ...]. apt then finds no arm64 packages from Docker's repository, so Install Docker Engine packages fails with no installable candidate, or a distribution docker.io is picked up silently. The role already gathers facts, so it can choose the right value itself.

Out of scope: any non-Ubuntu platform, and the apt source file format.

Proposal

  • Default docker_apt_arch to a value derived from ansible_facts['architecture'] (x86_64 gives amd64, aarch64 gives arm64), and fail with a clear message for any other architecture instead of guessing.
  • An explicitly set docker_apt_arch keeps winning, so no existing override changes.
  • Update meta/argument_specs.yml, the README variable table and the Molecule verification, and add a changelog fragment (minor_changes).

Acceptance criteria

  • On an x86_64 host with no override the source line contains arch=amd64 (Molecule verify.yml reads the file).
  • With the fact set to aarch64 and no override it contains arch=arm64 (a converge case with ansible_architecture overridden, or an unit-style assert on the computed value).
  • With docker_apt_arch: amd64 set on an aarch64 fact, the override is used.
  • An unsupported architecture value fails the play with a message that names the variable.
  • ansible-test sanity, ansible-lint and yamllint are clean, and the README table matches argument_specs.yml.

Not verified

  • I have not run this role on an arm64 host. The failure above is what the source line and apt's behaviour imply, not something I reproduced with this role.
  • Whether arm64 is a platform you want to support: the README declares Ubuntu and amd64 as the default architecture, and the Molecule image is amd64 only.

Questions for the maintainer

  • Is deriving the value from the fact acceptable as the new default, given the README currently documents amd64?
  • Should an unsupported architecture fail, or fall back to amd64?

Assisted-by: Claude Code

## Problem `docker_apt_arch` defaults to `amd64`, and the README says to override it per host on anything else. On an arm64 Ubuntu host (for example a Raspberry Pi) that has not been overridden, the source line is written as `deb [arch=amd64 ...]`. apt then finds no `arm64` packages from Docker's repository, so `Install Docker Engine packages` fails with no installable candidate, or a distribution `docker.io` is picked up silently. The role already gathers facts, so it can choose the right value itself. Out of scope: any non-Ubuntu platform, and the apt source file format. ## Proposal - Default `docker_apt_arch` to a value derived from `ansible_facts['architecture']` (`x86_64` gives `amd64`, `aarch64` gives `arm64`), and fail with a clear message for any other architecture instead of guessing. - An explicitly set `docker_apt_arch` keeps winning, so no existing override changes. - Update `meta/argument_specs.yml`, the README variable table and the Molecule verification, and add a changelog fragment (`minor_changes`). ## Acceptance criteria - [ ] On an `x86_64` host with no override the source line contains `arch=amd64` (Molecule `verify.yml` reads the file). - [ ] With the fact set to `aarch64` and no override it contains `arch=arm64` (a converge case with `ansible_architecture` overridden, or an unit-style assert on the computed value). - [ ] With `docker_apt_arch: amd64` set on an `aarch64` fact, the override is used. - [ ] An unsupported architecture value fails the play with a message that names the variable. - [ ] `ansible-test sanity`, ansible-lint and yamllint are clean, and the README table matches `argument_specs.yml`. ## Not verified - I have not run this role on an arm64 host. The failure above is what the source line and apt's behaviour imply, not something I reproduced with this role. - Whether arm64 is a platform you want to support: the README declares Ubuntu and `amd64` as the default architecture, and the Molecule image is amd64 only. ## Questions for the maintainer - Is deriving the value from the fact acceptable as the new default, given the README currently documents `amd64`? - Should an unsupported architecture fail, or fall back to `amd64`? Assisted-by: Claude Code
Dragonish added the Kind/Enhancement
Status
Ready for Human
labels 2026-11-22 20:30:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#300