diff --git a/tasks/main.yml b/tasks/main.yml index 5e9f569..6dfe258 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -61,5 +61,27 @@ notify: - 'ensure_podman.package_facts' - 'ensure_podman.service_facts' +- name: 'Fetch kernel command line' + when: + - ansible_system = 'Linux' + - ensure_podman is defined + - ansible_distribution == 'Fedora' + - ansible_distribution_major_version is version('32', '>=') + shell: | + cat /proc/cmdline + register: 'results' + changed_when: 'false' +- name: 'Remove cgroups v1 if enabled' + when: + - results is defined + - ' "systemd.unified_cgroup_hierarchy=0" in results.stdout ' + shell: + cmd: | + grubby --update-kernel=ALL --remove args=systemd.unified_cgroup_hierarchy=0 +- name: 'Reboot to disable cgroups v1' + when: + - results is defined + - ' "systemd.unified_cgroup_hierarchy=0" in results.stdout ' + reboot: - name: 'flush handlers' meta: 'flush_handlers'