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 (#23)
Browse files Browse the repository at this point in the history
Fixes: #22
  • Loading branch information
ssbarnea authored Nov 27, 2020
1 parent 8138588 commit 7de8ae7
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 7de8ae7

Please sign in to comment.