Files
ansible-docker/roles/docker/tasks/main.yml
2022-11-25 20:00:47 +02:00

39 lines
895 B
YAML

---
- name: Install dependencies
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- lsb-release
update_cache: true
- name: Set dpkg arch (amd64)
set_fact:
dpkg_arch: amd64
when: ansible_architecture == 'x86_64'
- name: Set dpkg arch (arm64)
set_fact:
dpkg_arch: arm64
when: ansible_architecture == 'aarch64'
- name: Add docker repo signing key
apt_key:
id: '9DC858229FC7DD38854AE2D88D81803C0EBFCD88'
url: 'https://download.docker.com/linux/debian/gpg'
- name: Add docker repo
apt_repository:
repo: "deb [arch={{ dpkg_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
filename: 'docker'
mode: '644'
- name: Install docker
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- python3-docker