2023-06-24 18:50:41 +02:00
|
|
|
---
|
|
|
|
- name: install docker
|
|
|
|
hosts: "{{ hosts }}"
|
|
|
|
become: yes
|
|
|
|
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
|
|
|
|
update_cache: yes
|
|
|
|
- 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:
|
2023-06-24 18:50:41 +02:00
|
|
|
filename: docker
|
|
|
|
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-02-22 19:01:59 +01:00
|
|
|
update_cache: yes
|