initial commit

This commit is contained in:
2026-06-14 14:21:09 +07:00
commit 054835e2a7
17 changed files with 771 additions and 0 deletions

View 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