Browse Source

Merge "Stop and remove container with module"

tags/1.4.0
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
ee5226c525
1 changed files with 8 additions and 12 deletions
  1. +8
    -12
      tripleo_ansible/roles/tripleo_container_rm/tasks/tripleo_podman_container_rm.yml

+ 8
- 12
tripleo_ansible/roles/tripleo_container_rm/tasks/tripleo_podman_container_rm.yml View File

@@ -78,15 +78,11 @@
systemd:
daemon_reload: true

- name: "stat {{ container }} container"
command: "podman container exists {{ container }}"
failed_when: false
changed_when: false
register: stat_container

- name: Stop and remove container
command: "podman container rm --force {{ container }}"
changed_when: true
when:
- stat_container.rc is defined
- stat_container.rc == 0
- name: Stop and remove container if exists
podman_container:
name: "{{ container }}"
state: absent
register: result
until: result is success
retries: 5
delay: 10

Loading…
Cancel
Save