2021-06-11 15:05:20 +02:00
|
|
|
---
|
2024-03-03 16:43:55 +01:00
|
|
|
- name: Install Docker
|
|
|
|
hosts: all
|
2024-03-03 16:16:22 +01:00
|
|
|
become: true
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2021-06-11 15:05:20 +02:00
|
|
|
tasks:
|
2024-03-03 16:54:47 +01:00
|
|
|
- name: Install prerequisites
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt:
|
2021-06-11 15:05:20 +02:00
|
|
|
name:
|
|
|
|
- apt-transport-https
|
2024-03-03 15:59:49 +01:00
|
|
|
- ca-certificates
|
|
|
|
- curl
|
2021-06-11 15:05:20 +02:00
|
|
|
- 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 apt-key
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt_key:
|
2021-06-11 15:05:20 +02:00
|
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:54:47 +01:00
|
|
|
- name: Add docker repo
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt_repository:
|
2021-06-11 15:05:20 +02:00
|
|
|
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 16:54:47 +01:00
|
|
|
- name: Install docker
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.apt:
|
2024-03-03 15:59:49 +01:00
|
|
|
name:
|
2021-06-11 15:05:20 +02:00
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
|
|
|
- containerd.io
|
|
|
|
- docker-compose
|
2024-03-03 16:16:22 +01:00
|
|
|
update_cache: true
|
2024-03-03 16:34:29 +01:00
|
|
|
|
2024-03-03 17:25:42 +01:00
|
|
|
- name: Add user vagrant to group docker
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: vagrant
|
|
|
|
groups: docker
|
|
|
|
append: true
|