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.
|
||||
|
||||
|
||||
- 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"
|
||||
vars:
|
||||
container: "{{ item }}"
|
||||
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
|
||||
# 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
|
||||
docker_container:
|
||||
name: "{{ container }}"
|
||||
state: absent
|
||||
when:
|
||||
- stat_docker_container.rc == 0
|
||||
|
Loading…
Reference in New Issue
Block a user