-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_install_runtime.yml
More file actions
58 lines (52 loc) · 1.67 KB
/
02_install_runtime.yml
File metadata and controls
58 lines (52 loc) · 1.67 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: 2. Install Containerd Runtime
hosts: all
become: yes
tasks:
- name: Install prerequisite packages for Containerd
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gpg
- tar
state: present
update_cache: yes
- name: Download and install runc
ansible.builtin.get_url:
url: https://github.com/opencontainers/runc/releases/download/v1.4.0-rc.1/runc.amd64
dest: /usr/local/sbin/runc
owner: root
group: root
mode: '0755'
- name: Create CNI plugins directory
ansible.builtin.file:
path: /opt/cni/bin
state: directory
owner: root
group: root
mode: '0755'
- name: Download and extract CNI plugins
ansible.builtin.unarchive:
src: https://github.com/containernetworking/plugins/releases/download/v1.8.0/cni-plugins-linux-amd64-v1.8.0.tgz
dest: /opt/cni/bin
remote_src: yes
owner: root
group: root
mode: '0755'
- name: Create default Containerd config file
ansible.builtin.shell: "containerd config default | tee /etc/containerd/config.toml"
args:
creates: /etc/containerd/config.toml
- name: Enable SystemdCgroup in Containerd config
ansible.builtin.lineinfile:
path: /etc/containerd/config.toml
line: ' SystemdCgroup = true'
insertafter: 'BinaryName = ""'
- name: Ensure containerd service is enabled and started
ansible.builtin.systemd_service:
name: containerd
state: started
enabled: yes
daemon_reload: yes