From c98a07825b281f0eca425cc261d4c0837730525e Mon Sep 17 00:00:00 2001 From: Cristian Calin <6627509+cristicalin@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:19:33 +0200 Subject: [PATCH] Use cgroupsv2 where available (fedora) (#8237) * Containerd: use cgroupsv2 where available (fedora) * Docker: use cgroupsv2 where available (fedora) * cri-o: use cgroupsv2 where available (fedora) --- roles/container-engine/containerd/tasks/main.yml | 16 ---------------- roles/container-engine/cri-o/tasks/main.yaml | 16 ---------------- roles/container-engine/docker/tasks/main.yml | 14 -------------- 3 files changed, 46 deletions(-) diff --git a/roles/container-engine/containerd/tasks/main.yml b/roles/container-engine/containerd/tasks/main.yml index 4573e0d17..1c556bdf3 100644 --- a/roles/container-engine/containerd/tasks/main.yml +++ b/roles/container-engine/containerd/tasks/main.yml @@ -5,22 +5,6 @@ when: - ansible_distribution not in ["CentOS", "OracleLinux", "RedHat", "Ubuntu", "Debian", "Fedora", "AlmaLinux", "Rocky", "Amazon", "Flatcar", "Flatcar Container Linux by Kinvolk", "Suse", "openSUSE Leap", "openSUSE Tumbleweed"] -- name: disable unified_cgroup_hierarchy in Fedora 31+ - command: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - - not is_ostree - -- name: reboot in Fedora 31+ - reboot: - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - - not is_ostree - - name: containerd | Remove any package manager controlled containerd package package: name: "{{ containerd_package }}" diff --git a/roles/container-engine/cri-o/tasks/main.yaml b/roles/container-engine/cri-o/tasks/main.yaml index d3997f4a5..45e60ef74 100644 --- a/roles/container-engine/cri-o/tasks/main.yaml +++ b/roles/container-engine/cri-o/tasks/main.yaml @@ -35,22 +35,6 @@ tags: - facts -- name: disable unified_cgroup_hierarchy in Fedora 31+ - command: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - - not is_ostree - -- name: reboot in Fedora 31+ - reboot: - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - - not is_ostree - - name: import crio repo import_tasks: "crio_repo.yml" when: crio_add_repos diff --git a/roles/container-engine/docker/tasks/main.yml b/roles/container-engine/docker/tasks/main.yml index 4d0ea5db6..05784e912 100644 --- a/roles/container-engine/docker/tasks/main.yml +++ b/roles/container-engine/docker/tasks/main.yml @@ -40,20 +40,6 @@ tags: - facts -- name: disable unified_cgroup_hierarchy in Fedora 31+ - command: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - -- name: reboot in Fedora 31+ - reboot: - when: - - ansible_distribution == "Fedora" - - (ansible_distribution_major_version | int) >= 31 - - ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] is not defined or ansible_proc_cmdline['systemd.unified_cgroup_hierarchy'] != '0' - - import_tasks: pre-upgrade.yml - name: ensure docker-ce repository public key is installed