Introduction
community.docker is the Ansible collection that provides modules and plugins to manage Docker hosts, containers, images, networks, volumes, Docker Compose stacks, and Docker Swarm clusters. Version 5.4.0 has been published on Ansible Galaxy, replacing the previous 5.3.0 release. This is a bugfix and feature release, with no breaking changes.
Whats New
Minor Changes
docker_swarm- on ansible-core 2.22+, theManagerandWorkerjoin tokens and theUnlockKeyreturned by the module are now marked as secrets. This means they will no longer be displayed in clear text in task output or logs when running against a Swarm cluster with a recent enough ansible-core (PR #1312).
Bugfixes
- All modules using the vendored Docker SDK for Python have an updated list of reasons that are recognized as "image not found" errors. Previously, some Docker daemon error messages indicating a missing image were not matched correctly, which could cause modules to fail or behave unexpectedly instead of treating the image as absent (PR #1315).
Affected Components
| Component | Change type | Reference |
|---|---|---|
docker_swarm module | Minor change - mark join tokens/UnlockKey as secrets on ansible-core 2.22+ | PR #1312 |
| Vendored Docker SDK for Python (all dependent modules) | Bugfix - updated "image not found" error detection | PR #1315 |
How to Install and Verify
# Install or upgrade community.docker to the latest version
ansible-galaxy collection install community.docker --upgrade
# Install the exact version 5.4.0
ansible-galaxy collection install community.docker:5.4.0
# Verify the installed version
ansible-galaxy collection list community.docker
# Check module documentation for docker_swarm
ansible-doc community.docker.docker_swarm
Conclusion
Administrators relying on docker_swarm to bootstrap or manage Swarm clusters should upgrade to 5.4.0 if they run ansible-core 2.22 or newer, to benefit from join tokens and the unlock key being treated as sensitive values. The fix to the vendored Docker SDK's image-not-found detection is relevant to any playbook that checks for image presence before pulling or building, and is a safe upgrade for all users of the collection.