Use ansible_cmdline instead of cat for /proc/cmdline

This commit is contained in:
Jason Rothstein 2021-02-08 22:37:11 -06:00
parent 6c89af9f26
commit a20e2cbf82

View File

@ -67,23 +67,19 @@
- 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
- results.stdout is defined
- ' "systemd.unified_cgroup_hierarchy=0" in results.stdout '
- ansible_cmdline is defined
- ansible_cmdline['systemd.unified_cgroup_hierarchy'] is defined
shell:
cmd: |
grubby --update-kernel=ALL --remove-args=systemd.unified_cgroup_hierarchy=0
- name: 'Reboot to disable cgroups v1'
when:
- results is defined
- results.stdout is defined
- ' "systemd.unified_cgroup_hierarchy=0" in results.stdout '
- ansible_system == 'Linux'
- ensure_podman is defined
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version is version('32', '>=')
- ansible_cmdline is defined
- ansible_cmdline['systemd.unified_cgroup_hierarchy'] is defined
reboot:
- name: 'flush handlers'
meta: 'flush_handlers'