Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
Prevent creation failure if containers already exists
Browse files Browse the repository at this point in the history
Fixes: #22
  • Loading branch information
ssbarnea committed Nov 26, 2020
1 parent 474c778 commit 150d733
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/molecule_podman/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
with_items: "{{ molecule_yml.platforms }}"
when: item.override_command | default(true)

# https://github.com/ansible-community/molecule-podman/issues/22
- name: Remove possible pre-existing containers
shell: >
podman container exists {{ item.name }} && podman rm {{ item.name }} -f || true
with_items: "{{ molecule_yml.platforms }}"

- name: Create molecule instance(s)
command: >
podman run
Expand Down

0 comments on commit 150d733

Please sign in to comment.