From 5c1a3a3ac2086119bd16316dde379047d90cd86c Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 3 Feb 2020 19:13:17 +0100 Subject: docker_container and docker_swarm_service: allow to actually disable healthcheck of image (#66599) * Allow to actually disable healthcheck of image. * Add changelog. --- lib/ansible/modules/cloud/docker/docker_container.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ansible/modules/cloud/docker/docker_container.py') diff --git a/lib/ansible/modules/cloud/docker/docker_container.py b/lib/ansible/modules/cloud/docker/docker_container.py index 24856e8aa5..2c8c7df85d 100644 --- a/lib/ansible/modules/cloud/docker/docker_container.py +++ b/lib/ansible/modules/cloud/docker/docker_container.py @@ -1480,6 +1480,10 @@ class TaskParameters(DockerBaseClass): if self.client.option_minimal_versions[value]['supported']: result[key] = getattr(self, value) + if self.disable_healthcheck: + # Make sure image's health check is overridden + result['healthcheck'] = {'test': ['NONE']} + if self.networks_cli_compatible and self.networks: network = self.networks[0] params = dict() -- cgit v1.2.1