From c2f737d5a259e4eeb5565b685041513589ee3c89 Mon Sep 17 00:00:00 2001 From: slicen Date: Fri, 12 Mar 2021 23:47:48 +1100 Subject: [PATCH] Only fetch docker-compose if current version is not the desired version --- tasks/docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/docker-compose.yml b/tasks/docker-compose.yml index 27c788b..1dee81d 100644 --- a/tasks/docker-compose.yml +++ b/tasks/docker-compose.yml @@ -1,6 +1,6 @@ --- - name: Check current docker-compose version. - command: docker-compose --version + command: "{{ docker_compose_path }} --version" register: docker_compose_current_version changed_when: false failed_when: false @@ -18,3 +18,6 @@ url: "{{ docker_compose_url }}" dest: "{{ docker_compose_path }}" mode: 0755 + when: > + docker_compose_current_version.stdout is not defined + or docker_compose_version not in docker_compose_current_version.stdout