Merge "Cover the case when the container engine is not available."

This commit is contained in:
Zuul 2019-07-18 12:44:54 +00:00 committed by Gerrit Code Review
commit 81427894df
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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