Force removal of stopped or running containers

Use --force to remove containers, no matter what is its
current state.

Closes-Bug: #1836145
Change-Id: I20bdb523d918adb33c5f72512d960d3709bd4895
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2019-07-11 09:41:34 -05:00 committed by Sagi Shnaidman
parent add4969e6b
commit 78951712ad
1 changed files with 2 additions and 6 deletions

View File

@ -73,11 +73,7 @@
register: stat_container
- name: Stop and remove container
command: "podman container rm --force {{ container }}"
changed_when: true
when:
- stat_container.rc == 0
block:
- name: Stop container
command: podman container kill "{{ container }}"
- name: "remove {{ container }} container"
command: "podman container rm {{ container }}"