mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-06 14:14:22 -07:00
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:
parent
49f56697bb
commit
6fca49f445
11 changed files with 251 additions and 181 deletions
|
@ -36,10 +36,13 @@
|
|||
- name: "Comparison: use 'docker network inspect'"
|
||||
command: docker network inspect "{{ nname }}"
|
||||
register: docker_inspect
|
||||
- set_fact:
|
||||
docker_inspect_result: "{{ docker_inspect.stdout | from_json }}"
|
||||
- name: Dump docker inspect result
|
||||
debug: var=docker_inspect_result
|
||||
ignore_errors: yes
|
||||
- block:
|
||||
- set_fact:
|
||||
docker_inspect_result: "{{ docker_inspect.stdout | from_json }}"
|
||||
- name: Dump docker inspect result
|
||||
debug: var=docker_inspect_result
|
||||
when: docker_inspect is not failed
|
||||
|
||||
- name: Cleanup
|
||||
docker_network:
|
||||
|
@ -52,7 +55,15 @@
|
|||
- result.exists
|
||||
- "'network' in result"
|
||||
- "result.network"
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.network == docker_inspect_result[0]"
|
||||
when: docker_inspect is not failed
|
||||
- assert:
|
||||
that:
|
||||
- "'is too new. Maximum supported API version is' in docker_inspect.stderr"
|
||||
when: docker_inspect is failed
|
||||
|
||||
when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.21', '>=')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue