mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
Add ability to look up the latest docker-compose version on Github API
This commit is contained in:
parent
fa52c5f28b
commit
33c5c2e6d0
@ -5,6 +5,20 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Get latest version from docker-compose (if configured)
|
||||||
|
block:
|
||||||
|
- name: Get latest version of docker-compose from Github API
|
||||||
|
uri:
|
||||||
|
url: https://api.github.com/repos/docker/compose/releases/latest
|
||||||
|
return_content: yes
|
||||||
|
register: url_content
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- name: Set latest version in docker_compose_version variable
|
||||||
|
set_fact:
|
||||||
|
docker_compose_version: "{{url_content.json.name }}"
|
||||||
|
when: docker_compose_version == 'latest'
|
||||||
|
|
||||||
- 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 }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user