Don't die when docker CLI doesn't want to work with docker daemon (#366)

* Don't die when docker CLI doesn't want to work with docker daemon.

* Allow more 'docker volume ls' failures

* More.

* Fix more failures.

* Forgot ignore_errors.

* Another one.

* More places.

* Try to install newer docker on RHEL8.

* Also restrict docker-ce-cli.
This commit is contained in:
Felix Fontein 2020-05-20 08:40:04 +02:00 committed by GitHub
commit 6fca49f445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 251 additions and 181 deletions

View file

@ -34,10 +34,13 @@
- name: "Comparison: use 'docker volume inspect'"
command: docker volume inspect "{{ cname }}"
register: docker_volume_inspect
- set_fact:
docker_volume_inspect_result: "{{ docker_volume_inspect.stdout | from_json }}"
- name: Dump docker volume inspect result
debug: var=docker_volume_inspect_result
ignore_errors: yes
- block:
- set_fact:
docker_volume_inspect_result: "{{ docker_volume_inspect.stdout | from_json }}"
- name: Dump docker volume inspect result
debug: var=docker_volume_inspect_result
when: docker_volume_inspect is not failed
- name: Cleanup
docker_volume:
@ -49,7 +52,15 @@
- result.exists
- "'volume' in result"
- "result.volume"
- assert:
that:
- "result.volume == docker_volume_inspect_result[0]"
when: docker_volume_inspect is not failed
- assert:
that:
- "'is too new. Maximum supported API version is' in docker_volume_inspect.stderr"
when: docker_volume_inspect is failed
# Requirements for docker_volume
when: docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.24', '>=')