2023-06-24 18:50:41 +02:00
|
|
|
---
|
2024-03-03 16:54:47 +01: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
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2023-06-24 18:50:41 +02:00
|
|
|
tasks:
|
2024-03-03 16:54:47 +01:00
|
|
|
- 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
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:54:47 +01: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
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:54:47 +01:00
|
|
|
- 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
|
2024-03-03 17:01:00 +01:00
|
|
|
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename | lower }} stable
|
2023-06-24 18:50:41 +02:00
|
|
|
state: present
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:54:47 +01:00
|
|
|
- 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
|