From 87180e6f5e64a63244890d18bfb338baa7ab041e Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 16 May 2021 16:47:26 +0200 Subject: [PATCH] fix: fix idempotency in docker_compose --- plugins/modules/docker_compose.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/modules/docker_compose.py b/plugins/modules/docker_compose.py index a1b2f85..e02cb7e 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -786,7 +786,7 @@ class ContainerManager(DockerBaseClass): ) result["actions"].append(result_action) - if not self.check_mode and result["changed"]: + if not self.check_mode and result["changed"] and not self.stopped: out_redir_name, err_redir_name = make_redirection_tempfiles() try: with stdout_redirector(out_redir_name): @@ -800,8 +800,7 @@ class ContainerManager(DockerBaseClass): do_build=do_build, detached=detached, remove_orphans=self.remove_orphans, - timeout=self.timeout, - start=not self.stopped + timeout=self.timeout ) except Exception as exc: fail_reason = get_failure_info(