From 3800fd2d42448d8fd59c43a6718a8b67e9d097d5 Mon Sep 17 00:00:00 2001 From: berthin Date: Sat, 5 Nov 2022 11:20:04 +0100 Subject: [PATCH] Fix condition for empty docker compose svn --- tasks/docker-compose.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/docker-compose.yml b/tasks/docker-compose.yml index 42f89cb..53a4482 100644 --- a/tasks/docker-compose.yml +++ b/tasks/docker-compose.yml @@ -8,7 +8,9 @@ - set_fact: docker_compose_current_version: "{{ docker_compose_vsn.stdout | regex_search('(\\d+(\\.\\d+)+)') }}" - when: docker_compose_vsn.stdout is defined + when: > + docker_compose_vsn.stdout is defined + and (docker_compose_vsn.stdout | length > 0) - name: Delete existing docker-compose version if it's different. file: @@ -25,5 +27,5 @@ mode: 0755 when: > (docker_compose_current_version is not defined) - or (docker_compose_current_version|length == 0) + or (docker_compose_current_version | length == 0) or (docker_compose_current_version is version((docker_compose_version | regex_replace('v', '')), '<'))