Merge "Ensure docker is running before dropping containers"

This commit is contained in:
Zuul 2019-02-19 05:31:42 +00:00 committed by Gerrit Code Review
commit 8c67a716bf
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,12 @@
path: /usr/bin/docker
register: docker_path_stat
- name: Ensure docker service is running
when: docker_path_stat.stat.exists
systemd:
name: docker
register: docker_service_state
- name: remove "{{ containers_to_rm|join(', ') }}" containers
docker_container:
name: "{{ item }}"
@ -11,4 +17,5 @@
when:
- container_cli == 'podman'
- docker_path_stat.stat.exists
- docker_service_state.status['SubState'] == 'running'
with_items: "{{ containers_to_rm }}"