initial commit
This commit is contained in:
35
ansible/playbooks/03-containerd.yml
Normal file
35
ansible/playbooks/03-containerd.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: Install and configure containerd
|
||||
hosts: k8s
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Add Docker CE repo (provides containerd.io)
|
||||
get_url:
|
||||
url: https://download.docker.com/linux/centos/docker-ce.repo
|
||||
dest: /etc/yum.repos.d/docker-ce.repo
|
||||
|
||||
- name: Install containerd
|
||||
dnf:
|
||||
name: containerd.io
|
||||
state: present
|
||||
|
||||
- name: Create containerd config directory
|
||||
file:
|
||||
path: /etc/containerd
|
||||
state: directory
|
||||
|
||||
- name: Generate default containerd config (overwrites Docker CE default which disables CRI)
|
||||
shell: containerd config default > /etc/containerd/config.toml
|
||||
|
||||
- name: Enable SystemdCgroup in containerd config
|
||||
replace:
|
||||
path: /etc/containerd/config.toml
|
||||
regexp: 'SystemdCgroup = false'
|
||||
replace: 'SystemdCgroup = true'
|
||||
|
||||
- name: Enable and start containerd
|
||||
systemd:
|
||||
name: containerd
|
||||
enabled: true
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user