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:
parent
b2a222b136
commit
a00d615d68
3 changed files with 15 additions and 4 deletions
|
@ -7,8 +7,8 @@ docker_packages:
|
||||||
- docker-ce
|
- docker-ce
|
||||||
|
|
||||||
docker_pip_extra_packages: []
|
docker_pip_extra_packages: []
|
||||||
docker_pip_packages:
|
docker_pip_package: docker
|
||||||
- docker
|
docker_pip_package_limit: ''
|
||||||
|
|
||||||
docker_cleanup_packages:
|
docker_cleanup_packages:
|
||||||
- docker
|
- docker
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- name: remove pip packages
|
- name: remove pip packages
|
||||||
pip:
|
pip:
|
||||||
state: present
|
state: present
|
||||||
name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}"
|
name: "{{ [docker_pip_package] | union(docker_pip_extra_packages) }}"
|
||||||
listen: cleanup docker
|
listen: cleanup docker
|
||||||
when: not docker_skip_cleanup | bool
|
when: not docker_skip_cleanup | bool
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,21 @@
|
||||||
paths:
|
paths:
|
||||||
- "{{ role_path }}/tasks"
|
- "{{ 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
|
- name: Install Python requirements
|
||||||
pip:
|
pip:
|
||||||
state: present
|
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 }}"
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
notify: cleanup docker
|
notify: cleanup docker
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue