* fix: map docker_swarm_service command/args to ContainerSpec.Args
docker service create IMAGE [COMMAND] [ARG...] places post-image tokens
into ContainerSpec.Args so the image ENTRYPOINT is preserved. The module
previously wrote command to ContainerSpec.Command, which replaced the
entrypoint and broke flag-style commands such as -config.file=...
Fixes#1044Fixes#212
* Add command_as_args option for CLI-compatible command mapping
Keep the historical default (command -> ContainerSpec.Command,
args -> ContainerSpec.Args) to avoid a breaking change. When
command_as_args=true, map command+args to ContainerSpec.Args to
match docker service create and preserve the image ENTRYPOINT.
Update docs, examples, unit tests for both modes, and the changelog
fragment. Addresses review feedback on #1307 / #1044.
* Update changelogs/fragments/1044-swarm-service-command-args.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/docker_swarm_service.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/1044-swarm-service-command-args.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: VedantMadane <vedant@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Fix IP address retrieval for registry setup.
* Adjust push detection to Docker 29.
* Idempotency for export no longer works.
* Disable pull idempotency checks that play with architecture.
* Add more known image IDs.
* Adjust load tests.
* Adjust error message check.
* Allow for more digests.
* Make sure a new enough cryptography version is installed.
* Add debug flag to failing task.
* Add more debug output.
* Fix pull idempotency.
* Revert "Add more debug output."
This reverts commit 64020149bf.
* Fix casing.
* Remove unreliable test.
* Add 'debug: true' to all tasks.
* Reformat.
* Fix idempotency problem for IPv6 addresses.
* Fix expose ranges handling.
* Update changelog fragment to also mention other affected modules.
In 3350283bcc, a subtle bug was introduced
by renaming this variable. For image builds that go down the `else`
branch, they never set this variable, which is then referenced below
when constructing the `params` dict. This results in a very confusing
bug from the Docker backend when trying to construct images:
> An unexpected Docker error occurred: 500 Server Error for
> http+docker://localhost/v1.51/build?t=molecule_local%2Fubuntu%3A24.04&q=False&nocache=False&rm=True&forcerm=True&pull=True&dockerfile=%2Fhome%2Fci%2F.ansible%2Ftmp%2Fmolecule.IaMj.install-github%2FDockerfile_ubuntu_24_04:
> Internal Server Error ("Cannot locate specified Dockerfile:
> /home/ci/.ansible/tmp/molecule.IaMj.install-github/Dockerfile_ubuntu_24_04")
Within the Docker daemon logs, the actual error presents itself like
this:
> level=debug msg="FIXME: Got an API for which error does not match any
> expected type!!!" error="Cannot locate specified Dockerfile:
> $HOME/.ansible/tmp/molecule.5DrS.install-package/Dockerfile_ubuntu_24_04"
> error_type="*errors.fundamental" module=api
Unfortunately, these are all red herrings and the actual cause of the
problem isn't Docker itself or the missing file, but in fact the
`docker_image` module not passing the correct parameter data here.