diff --git a/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml b/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml new file mode 100644 index 0000000000..2239d22121 --- /dev/null +++ b/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml @@ -0,0 +1,2 @@ +bugfixes: +- "docker_swarm_service - fixing falsely reporting ``update_order`` as changed when option is not used." diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_service.py b/lib/ansible/modules/cloud/docker/docker_swarm_service.py index dede723c22..0294abc8ce 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm_service.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm_service.py @@ -719,7 +719,7 @@ class DockerService(DockerBaseClass): differences.add('update_monitor', parameter=self.update_monitor, active=os.update_monitor) if self.update_max_failure_ratio != os.update_max_failure_ratio: differences.add('update_max_failure_ratio', parameter=self.update_max_failure_ratio, active=os.update_max_failure_ratio) - if self.update_order != os.update_order: + if self.update_order is not None and self.update_order != os.update_order: differences.add('update_order', parameter=self.update_order, active=os.update_order) if self.image != os.image.split('@')[0]: differences.add('image', parameter=self.image, active=os.image.split('@')[0])