mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
docker_swarm: add diff support (#52947)
* Add diff support to docker_swarm. * Add changelog. * Using diff mode for docker_swarm tests. This improves debugging, since the the module now outputs more information on *why* it did certain actions.
This commit is contained in:
parent
84cc5202db
commit
bf3c291606
3 changed files with 33 additions and 0 deletions
|
@ -391,6 +391,11 @@ class SwarmManager(DockerBaseClass):
|
|||
|
||||
choice_map.get(self.state)()
|
||||
|
||||
if self.client.module._diff or self.parameters.debug:
|
||||
diff = dict()
|
||||
diff['before'], diff['after'] = self.differences.get_before_after()
|
||||
self.results['diff'] = diff
|
||||
|
||||
def __isSwarmManager(self):
|
||||
try:
|
||||
data = self.client.inspect_swarm()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue