tripleo-common/roles/tripleo-docker-rm/tasks/main.yaml

18 lines
455 B
YAML

---
- name: Check if docker is installed
stat:
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
with_items: "{{ containers_to_rm }}"