mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-23 19:06:54 +01:00
Attempt to fix some Docker compose version comparison bugs.
This commit is contained in:
parent
48d5a077d5
commit
cef4b7892e
@ -8,15 +8,15 @@
|
|||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
docker_compose_current_version: "{{ docker_compose_vsn.stdout | regex_search('(\\d+(\\.\\d+)+)') }}"
|
docker_compose_current_version: "{{ docker_compose_vsn.stdout | regex_search('(\\d+(\\.\\d+)+)') }}"
|
||||||
when:
|
when: docker_compose_vsn.stdout is defined
|
||||||
- docker_compose_vsn.stdout is defined
|
|
||||||
- name: Delete existing docker-compose version if it's different.
|
- name: Delete existing docker-compose version if it's different.
|
||||||
file:
|
file:
|
||||||
path: "{{ docker_compose_path }}"
|
path: "{{ docker_compose_path }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: >
|
when: >
|
||||||
docker_compose_current_version.stdout is defined
|
docker_compose_current_version.stdout is defined
|
||||||
and docker_compose_version not in docker_compose_current_version.stdout
|
and (docker_compose_version | regex_replace('v', '')) not in docker_compose_current_version.stdout
|
||||||
|
|
||||||
- name: Install Docker Compose (if configured).
|
- name: Install Docker Compose (if configured).
|
||||||
get_url:
|
get_url:
|
||||||
@ -26,4 +26,4 @@
|
|||||||
when: >
|
when: >
|
||||||
(docker_compose_current_version is not defined)
|
(docker_compose_current_version is not defined)
|
||||||
or (docker_compose_current_version|length == 0)
|
or (docker_compose_current_version|length == 0)
|
||||||
or (docker_compose_current_version is version(docker_compose_version, '<'))
|
or (docker_compose_current_version is version((docker_compose_version | regex_replace('v', '')), '<'))
|
||||||
|
Loading…
Reference in New Issue
Block a user