2019-07-22 10:32:01 +02:00
|
|
|
---
|
|
|
|
# Install HTTPS support for APT
|
|
|
|
- name: Install apt-transport-https
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name:
|
|
|
|
- apt-transport-https
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- gnupg2
|
|
|
|
- software-properties-common
|
|
|
|
state: present
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
# Add the key
|
|
|
|
- name: Configure the apt key
|
|
|
|
apt_key:
|
|
|
|
url: https://download.docker.com/linux/debian/gpg
|
|
|
|
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
|
|
|
state: present
|
|
|
|
register: apt_key_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_key_result is succeeded
|
|
|
|
|
|
|
|
# Add the repository into source list
|
2019-07-25 19:10:50 +02:00
|
|
|
- name: Configure docker repository
|
2019-07-22 10:32:01 +02:00
|
|
|
apt_repository:
|
|
|
|
repo: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
loop:
|
|
|
|
- deb https://download.docker.com/linux/debian buster stable
|
|
|
|
|
|
|
|
- name: Install docker
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
|
|
|
- containerd.io
|
|
|
|
state: present
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-07-25 19:10:50 +02:00
|
|
|
|
|
|
|
# Compose need to be updated to use new Docker features
|
|
|
|
- name: Install Docker Compose
|
|
|
|
get_url:
|
|
|
|
url: https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-x86_64
|
|
|
|
dest: /usr/local/bin/docker-compose
|
|
|
|
mode: "0755"
|
|
|
|
|
2021-03-30 10:08:21 +02:00
|
|
|
- include_role:
|
|
|
|
name: update_motd
|
|
|
|
vars:
|
|
|
|
motd_messages:
|
|
|
|
- key: 10-docker
|
|
|
|
message: >-
|
|
|
|
Docker est installé sur ce serveur.
|
|
|
|
...
|