Open jimrobinson opened 1 year ago
Files identified in the description: None
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
!component =ansible_collections/community/docker/plugins/modules/docker_swarm_service.py
Files identified in the description:
ansible_collections/community/docker/plugins/modules/docker_swarm_service.py
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
This repositoriy is for the community.general collection. You are filing a bug for the community.docker collection. Please use the correct repository the next time; I'll move this issue over for today.
The docker_swarm_service does not know anything about stacks (the documentation also does not mention stacks, and neither does its source code) and thus does not actively support updating services inside a stack. Using it for that is on your own risk.
https://docs.docker.com/engine/reference/commandline/service/ does not mention stacks either.
If your module isn't supposed to act in any fashion like 'docker service' then it'd be good to mention that in your documentation.
@jimrobinson feel free to create a PR to update the documentation. It's also "your" module, since you are as much part of the community as I am.
Summary
I'm unsure of this is a bug or not, it's certainly not acting as I would have expected it to. Say I have a stack named ib, containing three services, db, ibeam, and ibexecution:
Then I can, if I need to, restart a service using the command "docker service update --force". An example of restarting the ib_ibeam service by command line:
You can see from this capture that ib_ibeam always remained part of the 'ib' stack through the restart. When I removed the ib stack the three services were removed.
Looking over the ansible modules I thought that
community.docker.docker_swarm_service
was the module that would let me perform a similar task:This does not have the result I was expecting. As far as I can tell what it is doing is shutting down ib_ibeam within the ib stack and then starting up an independent service named ib_ibeam (but which is not part of the ib stack):
I can work around the issue by just using ansible.builtin.command to execute the "docker service update --force ib_ibeam" command, but I wanted to ask if it's expected that the docker_swarm_service behave this way?
Issue Type
Bug Report
Component Name
community.docker.docker_swarm_service
Ansible Version
Community.general Version
Configuration
OS / Environment
Steps to Reproduce
The following is a minimal playbook that mocks up the scenario, and does appear to behave the same way as my real life instance.
Expected Results
I expect the ib_ibeam service from within my stack to be restarted the same as if I issued the following from the command line:
Actual Results
The ib_ibeam service is shut down within the ib stack and a completely independent service named ib_ibeam (but not associated with the stack) is started.
Code of Conduct