Files
Dragonish ba96e98585
Build / build (pull_request) Successful in 19s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 25s
feat(docker): derive the apt architecture from the host
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
2026-11-23 19:30:31 +00:00

83 lines
3.2 KiB
YAML

---
argument_specs:
main:
short_description: Install, update or remove Docker Engine
description:
- >-
Installs Docker Engine from the upstream APT repository, or removes it when C(docker_remove) is true. Optionally updates the packages to
the current candidate versions, then adds C(docker_users) to C(docker_group).
- Needs gathered facts, because the APT source uses C(ansible_distribution_release).
options:
docker_remove:
type: bool
default: false
description:
- >-
Removes Docker instead of installing it. Stops the service, removes the packages, the APT source and the keyring,
and skips the install, update and group tasks.
docker_remove_data:
type: bool
default: false
description:
- >-
Only used with C(docker_remove). Purges the packages and deletes C(/var/lib/docker), which destroys images, containers and volumes.
docker_update:
type: bool
default: false
description:
- >-
Upgrades each package in C(docker_packages) to its current APT candidate version, pinned as package=version.
The C(Restart docker) handler is notified only when a package actually changes.
docker_packages:
type: list
elements: str
default: [docker-ce, docker-ce-cli, containerd.io]
description:
- Packages installed, updated or removed.
docker_keyring_path:
type: path
default: /etc/apt/keyrings/docker.asc
description:
- Where the Docker repository key is stored.
docker_apt_list_path:
type: path
default: /etc/apt/sources.list.d/docker.list
description:
- APT source file written for the Docker repository.
docker_gpg_url:
type: str
default: https://download.docker.com/linux/ubuntu/gpg
description:
- URL of the repository signing key.
docker_repo_base_url:
type: str
default: https://download.docker.com/linux/ubuntu
description:
- Base URL of the repository. The source line uses C(ansible_distribution_release) and the C(stable) component.
docker_apt_arch:
type: str
default: ""
description:
- >-
Architecture written into the APT source. Empty (the default) derives it from the host: C(x86_64) gives C(amd64), C(aarch64)
gives C(arm64). Any other host architecture fails the play, so set this to the name Docker publishes for it. Lowercase letters
and digits only. A value set here is always used.
docker_service:
type: str
default: docker
description:
- Name of the systemd unit that is enabled, started, restarted and stopped.
docker_group:
type: str
default: docker
description:
- Group that C(docker_users) are added to.
docker_users:
type: list
elements: str
default: []
description:
- >-
Existing users added to C(docker_group) with append. Empty by default, because a role that installs after docker creates its
run-as user too late and must join the group itself.