1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Try to fix docker tests (#764)

* Try to limit docker package version if API version is < 1.39.

* Fix error.

* Re-combine to one command.
This commit is contained in:
Felix Fontein 2020-08-11 10:04:14 +02:00 committed by GitHub
parent b2a222b136
commit a00d615d68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View file

@ -7,8 +7,8 @@ docker_packages:
- docker-ce
docker_pip_extra_packages: []
docker_pip_packages:
- docker
docker_pip_package: docker
docker_pip_package_limit: ''
docker_cleanup_packages:
- docker

View file

@ -1,7 +1,7 @@
- name: remove pip packages
pip:
state: present
name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}"
name: "{{ [docker_pip_package] | union(docker_pip_extra_packages) }}"
listen: cleanup docker
when: not docker_skip_cleanup | bool

View file

@ -27,10 +27,21 @@
paths:
- "{{ role_path }}/tasks"
# Detect docker API version
- name: Check Docker API version
command: "docker version -f {% raw %}'{{(index .Server.Components 0).Details.ApiVersion}}'{% endraw %}"
register: docker_api_version_stdout
ignore_errors: yes
- name: Limit docker pypi package version to < 4.3.0
set_fact:
docker_pip_package_limit: '<4.3.0'
when: (docker_api_version_stdout.stdout | default('0.0')) is version('1.39', '<')
- name: Install Python requirements
pip:
state: present
name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}"
name: "{{ [docker_pip_package ~ docker_pip_package_limit] + docker_pip_extra_packages }}"
extra_args: "-c {{ remote_constraints }}"
notify: cleanup docker