36 lines
867 B
YAML
36 lines
867 B
YAML
- name: Install prerequisites
|
|
apt:
|
|
pkg:
|
|
- ca-certificates
|
|
- curl
|
|
- gnupg
|
|
- lsb-release
|
|
- python3-pip
|
|
- name: Add APT key
|
|
apt_key:
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
|
keyring: /etc/apt/keyrings/docker.gpg
|
|
- name: Add repository
|
|
apt_repository:
|
|
repo: "deb [signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
|
- name: Install Docker
|
|
apt:
|
|
pkg:
|
|
- docker-ce
|
|
- docker-ce-cli
|
|
- containerd.io
|
|
- docker-compose-plugin
|
|
- name: Install Python modules
|
|
pip:
|
|
name:
|
|
- docker
|
|
- docker-compose
|
|
- name: Copy daemon.json
|
|
copy:
|
|
dest: /etc/docker/daemon.json
|
|
content: "{{ docker_daemon_config | to_json }}"
|
|
- name: Start Docker
|
|
systemd:
|
|
name: docker
|
|
enabled: true
|
|
state: started
|