35 lines
857 B
YAML
35 lines
857 B
YAML
---
|
|
- name: Install required packages
|
|
ansible.builtin.apt:
|
|
name:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- curl
|
|
- gnupg
|
|
- lsb-release
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Add Docker GPG key
|
|
ansible.builtin.apt_key:
|
|
url: https://download.docker.com/linux/{{ mydistribution }}/gpg
|
|
state: present
|
|
|
|
- name: Add Docker repository
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ mydistribution }} {{ ansible_distribution_release }} stable"
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Install Docker Engine
|
|
ansible.builtin.apt:
|
|
name:
|
|
- docker-ce
|
|
- docker-ce-cli
|
|
- containerd.io
|
|
- docker-buildx-plugin
|
|
- docker-compose-plugin
|
|
- docker-compose
|
|
- python3-docker
|
|
state: latest
|
|
update_cache: true
|