Install docker-compose using pip

Change-Id: I9fe62b1d0501c8fd25c5bd210a423a5d8c41922f
This commit is contained in:
Federico Ressi 2022-01-07 12:44:30 +01:00
parent ab00cdf3d4
commit a6d9345105
3 changed files with 13 additions and 1 deletions

View File

@ -3,6 +3,7 @@
- hosts: all - hosts: all
roles: roles:
- role: ensure-docker - role: ensure-docker
- role: tobiko-ensure-python3
- role: tobiko-ensure-docker-compose - role: tobiko-ensure-docker-compose
- role: tobiko-docker-compose - role: tobiko-docker-compose
vars: vars:

View File

@ -1,3 +1,5 @@
--- ---
docker_compose_executable: /usr/local/bin/docker-compose docker_compose_executable: /usr/local/bin/docker-compose
docker_compose_install_using_pip: true
docker_compose_install_using_curl: not docker_compose_install_using_pip

View File

@ -1,6 +1,14 @@
--- ---
- name: "Install latest Docker compose" - name: "Install latest Docker compose with Pip"
become: true
shell: |
set -x
python3 -m pip install docker-compose
when: docker_compose_install_using_pip
- name: "Install latest Docker compose with Curl"
become: true become: true
shell: | shell: |
set -x set -x
@ -15,3 +23,4 @@
mkdir -p $(dirname '{{ docker_compose_executable }}') mkdir -p $(dirname '{{ docker_compose_executable }}')
curl -L ${URL} > '{{ docker_compose_executable }}' curl -L ${URL} > '{{ docker_compose_executable }}'
chmod +x '{{ docker_compose_executable }}' chmod +x '{{ docker_compose_executable }}'
when: docker_compose_install_using_curl