-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-docker.yaml
37 lines (31 loc) · 984 Bytes
/
install-docker.yaml
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
---
- name: docker setup
hosts: k8s
become: true
tasks:
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu jammy stable
state: present
- name: Update apt and install docker-ce
apt:
name: docker-ce
state: latest
update_cache: true
- name: "comment out disable cri plugin"
replace:
path: /etc/containerd/config.toml
regexp: 'disabled_plugins = \[\"cri\"\]'
replace: '# disabled_plugins = ["cri"]'
- name: enable and start docker service
command: systemctl enable --now docker
- name: enable and start containerd
command: systemctl enable --now containerd
- name: Restart service httpd, in all cases
ansible.builtin.service:
name: containerd
state: restarted