2023-06-24 18:50:41 +02:00
|
|
|
---
|
|
|
|
- name: install docker
|
2024-02-23 12:19:48 +01:00
|
|
|
hosts: "{{ my_hosts | d([]) }}"
|
2024-03-03 16:16:22 +01:00
|
|
|
become: true
|
2023-06-24 18:50:41 +02:00
|
|
|
tasks:
|
|
|
|
- name: install docker dependencies
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt:
|
2023-06-24 18:50:41 +02:00
|
|
|
name:
|
|
|
|
- apt-transport-https
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- gnupg-agent
|
|
|
|
- software-properties-common
|
2024-03-03 16:16:22 +01:00
|
|
|
update_cache: true
|
2023-06-24 18:50:41 +02:00
|
|
|
- name: add docker gpg key
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt_key:
|
2023-06-24 18:50:41 +02:00
|
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
|
|
|
state: present
|
|
|
|
keyring: /etc/apt/keyrings/docker.gpg
|
|
|
|
- name: add docker repository
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt_repository:
|
2024-03-03 15:59:49 +01:00
|
|
|
filename: docker
|
2023-06-24 18:50:41 +02:00
|
|
|
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename|lower }} stable
|
|
|
|
state: present
|
|
|
|
- name: install docker engine
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt:
|
2023-06-24 18:50:41 +02:00
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
|
|
|
- containerd.io
|
|
|
|
- docker-buildx-plugin
|
|
|
|
- docker-scan-plugin
|
|
|
|
- docker-compose-plugin
|
2024-03-03 16:16:22 +01:00
|
|
|
update_cache: true
|