2021-01-24 19:38:53 +01:00
|
|
|
---
|
|
|
|
- name: Add the docker repo key
|
|
|
|
apt_key:
|
|
|
|
url: https://download.docker.com/linux/debian/gpg
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add docker repo
|
|
|
|
apt_repository:
|
|
|
|
repo: deb [arch=amd64] https://download.docker.com/linux/debian buster stable
|
2021-01-24 20:01:42 +01:00
|
|
|
# TODO replace by "... /linux/debian $(lsb_release -cs) stable"
|
2021-01-24 19:38:53 +01:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Install docker
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
|
|
|
- containerd.io
|
|
|
|
state: latest
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2021-01-24 20:01:42 +01:00
|
|
|
|
2021-01-24 23:45:47 +01:00
|
|
|
# Official methode for docker compose, redundant with pip
|
|
|
|
#- name: Install docker-compose
|
|
|
|
# get_url:
|
|
|
|
# url: https://github.com/docker/compose/releases/download/1.28.0/docker-compose-Linux-x86_64
|
|
|
|
# # TODO: replace by "...1.28.0/docker-compose-$(uname -s)-$(uname -m)"
|
|
|
|
# dest: /usr/local/bin/docker-compose
|
|
|
|
# mode: '0755'
|
|
|
|
|
|
|
|
# Methode requiered by ansible docker_compose module
|
|
|
|
- name: Install docker and docker-compose
|
|
|
|
pip:
|
|
|
|
name:
|
|
|
|
- docker
|
2021-01-27 02:02:33 +01:00
|
|
|
- docker-compose>=1.28.0
|