From 51e1f34b1c249bec208e65168b7391dd1e8bdb8b Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sat, 17 Nov 2018 17:09:30 -0500 Subject: [PATCH] Simplify logic in docker detection for docker-rm role Fix and simplify the logic that detects if Docker is installed on the host. Change-Id: I641f7546afeabf222bcbe148fbe6cc94547f5c92 --- roles/tripleo-docker-rm/tasks/main.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/tripleo-docker-rm/tasks/main.yaml b/roles/tripleo-docker-rm/tasks/main.yaml index 76cb49922..986afb2b1 100644 --- a/roles/tripleo-docker-rm/tasks/main.yaml +++ b/roles/tripleo-docker-rm/tasks/main.yaml @@ -4,14 +4,11 @@ path: /usr/bin/docker register: docker_path_stat -- set_fact: - docker_installed: "{{ docker_path_stat.results | map(attribute='stat') | map(attribute='exists') is any }}" - - name: remove "{{ containers_to_rm|join(', ') }}" containers docker_container: name: "{{ item }}" state: absent when: - container_cli == 'podman' - - docker_installed + - docker_path_stat.stat.exists with_items: "{{ containers_to_rm }}"