Merge "Cover the case when the container engine is not available."
This commit is contained in:
commit
81427894df
@ -15,7 +15,13 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
- name: Check for {{ tripleo_container_cli }} cli
|
||||||
|
command: "command -v {{ tripleo_container_cli }}"
|
||||||
|
register: check_container_cli
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- include_tasks: "tripleo_{{ tripleo_container_cli }}_container_rm.yml"
|
- include_tasks: "tripleo_{{ tripleo_container_cli }}_container_rm.yml"
|
||||||
vars:
|
vars:
|
||||||
container: "{{ item }}"
|
container: "{{ item }}"
|
||||||
with_items: "{{ tripleo_containers_to_rm }}"
|
with_items: "{{ tripleo_containers_to_rm }}"
|
||||||
|
when: check_container_cli.rc == 0
|
||||||
|
@ -14,8 +14,14 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
- name: "Check if {{ container }} is running in docker backend"
|
||||||
|
command: "docker inspect --type container --format exists {{ container }}"
|
||||||
|
register: stat_docker_container
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: remove "{{ container }}" container
|
- name: remove "{{ container }}" container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ container }}"
|
name: "{{ container }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
when:
|
||||||
|
- stat_docker_container.rc == 0
|
||||||
|
Loading…
Reference in New Issue
Block a user