From 037b6e9001d11c799572c41f7d7acfea11066e4d Mon Sep 17 00:00:00 2001 From: Mohamed Zaian Date: Mon, 6 Jan 2025 10:45:43 +0100 Subject: [PATCH] Set SystemdCgroup = true for containerd v2.0.x --- roles/container-engine/containerd/defaults/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/container-engine/containerd/defaults/main.yml b/roles/container-engine/containerd/defaults/main.yml index 2ee81f4a8c7..1e4618998d5 100644 --- a/roles/container-engine/containerd/defaults/main.yml +++ b/roles/container-engine/containerd/defaults/main.yml @@ -17,7 +17,12 @@ containerd_runc_runtime: root: "" base_runtime_spec: cri-base.json options: - systemdCgroup: "{{ containerd_use_systemd_cgroup | ternary('true', 'false') }}" + systemdCgroup: > + {% if containerd_version is version('2.0.0', '<') %} + false + {% else %} + {{ containerd_use_systemd_cgroup | ternary('true', 'false') }} + {% endif %} binaryName: "{{ bin_dir }}/runc" containerd_additional_runtimes: []