forked from Austinbreathesair/devops-interview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-playbook.yml
43 lines (38 loc) · 959 Bytes
/
docker-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- name: Install Docker
hosts: all
become: true
tasks:
- name: Remove conflicting packages
ansible.builtin.apt:
name:
- docker.io
- docker-doc
- docker-compose
- podman-docker
- containerd
- runc
state: absent
- name: Add Docker repository
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: https://download.docker.com/linux/ubuntu
suites: '{{ ansible_distribution_release }}'
components: stable
signed_by: https://download.docker.com/linux/ubuntu/gpg
- name: Install Docker
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: latest
update_cache: true
- name: Enable systemd service for Docker
ansible.builtin.systemd:
name: docker
enabled: true
state: started