From c01e67aef7d7b080ab93f3794e7a8def5d282ac6 Mon Sep 17 00:00:00 2001 From: "Alexandr N. Zamaraev" Date: Tue, 6 Apr 2021 09:57:52 +0700 Subject: [PATCH 1/5] fix #12 --- plugins/modules/docker_compose.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/modules/docker_compose.py b/plugins/modules/docker_compose.py index 823920186..5e5fbbd8c 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -770,7 +770,7 @@ def cmd_up(self): )) result['actions'].append(result_action) - if not self.check_mode and result['changed'] and not self.stopped: + if not self.check_mode and result['changed']: out_redir_name, err_redir_name = make_redirection_tempfiles() try: with stdout_redirector(out_redir_name): @@ -784,7 +784,8 @@ def cmd_up(self): do_build=do_build, detached=detached, remove_orphans=self.remove_orphans, - timeout=self.timeout) + timeout=self.timeout, + start=not self.stopped) except Exception as exc: fail_reason = get_failure_info(exc, out_redir_name, err_redir_name, msg_format="Error starting project %s") From 475a7d136addf81995eebaa90b1c2497d43f8600 Mon Sep 17 00:00:00 2001 From: "Alexandr N. Zamaraev" Date: Tue, 13 Apr 2021 10:11:31 +0700 Subject: [PATCH 2/5] Create 12-correct_pull_wo_starting.yaml --- changelogs/fragments/12-correct_pull_wo_starting.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/12-correct_pull_wo_starting.yaml diff --git a/changelogs/fragments/12-correct_pull_wo_starting.yaml b/changelogs/fragments/12-correct_pull_wo_starting.yaml new file mode 100644 index 000000000..c2344fc86 --- /dev/null +++ b/changelogs/fragments/12-correct_pull_wo_starting.yaml @@ -0,0 +1,2 @@ +bugfixes: +- docker-compose - fixed not pull if ``state: present`` and ``stopped: true`` From 95e89d25d812b1739fd17bb138bbc128e80f44a7 Mon Sep 17 00:00:00 2001 From: "Alexandr N. Zamaraev" Date: Tue, 13 Apr 2021 13:43:43 +0700 Subject: [PATCH 3/5] Update changelogs/fragments/12-correct_pull_wo_starting.yaml Co-authored-by: Felix Fontein --- changelogs/fragments/12-correct_pull_wo_starting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/12-correct_pull_wo_starting.yaml b/changelogs/fragments/12-correct_pull_wo_starting.yaml index c2344fc86..e0d6998fe 100644 --- a/changelogs/fragments/12-correct_pull_wo_starting.yaml +++ b/changelogs/fragments/12-correct_pull_wo_starting.yaml @@ -1,2 +1,2 @@ bugfixes: -- docker-compose - fixed not pull if ``state: present`` and ``stopped: true`` +- "docker-compose - fixed not pull if ``state: present`` and ``stopped: true`` (https://github.com/ansible-collections/community.docker/issues/12, https://github.com/ansible-collections/community.docker/pull/119)." From de5a1306d5b3d5b25b6b22e35abeece68dc1b817 Mon Sep 17 00:00:00 2001 From: "Alexandr N. Zamaraev" Date: Sun, 18 Apr 2021 11:43:55 +0700 Subject: [PATCH 4/5] Update changelogs/fragments/12-correct_pull_wo_starting.yaml Co-authored-by: Amin Vakil --- changelogs/fragments/12-correct_pull_wo_starting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/12-correct_pull_wo_starting.yaml b/changelogs/fragments/12-correct_pull_wo_starting.yaml index e0d6998fe..2082ba6c5 100644 --- a/changelogs/fragments/12-correct_pull_wo_starting.yaml +++ b/changelogs/fragments/12-correct_pull_wo_starting.yaml @@ -1,2 +1,2 @@ bugfixes: -- "docker-compose - fixed not pull if ``state: present`` and ``stopped: true`` (https://github.com/ansible-collections/community.docker/issues/12, https://github.com/ansible-collections/community.docker/pull/119)." +- "docker-compose - fix not pulling when ``state: present`` and ``stopped: true`` (https://github.com/ansible-collections/community.docker/issues/12, https://github.com/ansible-collections/community.docker/pull/119)." From 9c0c2b90b8c60abfe145b7d01afeac369b16892f Mon Sep 17 00:00:00 2001 From: "Alexandr N. Zamaraev" Date: Tue, 20 Apr 2021 09:49:37 +0700 Subject: [PATCH 5/5] Update docker_compose.py --- plugins/modules/docker_compose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/docker_compose.py b/plugins/modules/docker_compose.py index 5e5fbbd8c..e32d2df7e 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -795,7 +795,7 @@ def cmd_up(self): if self.stopped: stop_output = self.cmd_stop(service_names) - result['changed'] = stop_output['changed'] + result['changed'] |= stop_output['changed'] result['actions'] += stop_output['actions'] if self.restarted: