Use ansible_cmdline instead of cat for /proc/cmdline
This commit is contained in:
		| @@ -67,23 +67,19 @@ | |||||||
|     - ensure_podman is defined |     - ensure_podman is defined | ||||||
|     - ansible_distribution == 'Fedora' |     - ansible_distribution == 'Fedora' | ||||||
|     - ansible_distribution_major_version is version('32', '>=') |     - ansible_distribution_major_version is version('32', '>=') | ||||||
|   shell: | |     - ansible_cmdline is defined | ||||||
|     cat /proc/cmdline |     - ansible_cmdline['systemd.unified_cgroup_hierarchy'] is defined | ||||||
|   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 ' |  | ||||||
|   shell: |   shell: | ||||||
|     cmd: | |     cmd: | | ||||||
|       grubby --update-kernel=ALL --remove-args=systemd.unified_cgroup_hierarchy=0 |       grubby --update-kernel=ALL --remove-args=systemd.unified_cgroup_hierarchy=0 | ||||||
| - name: 'Reboot to disable cgroups v1' | - name: 'Reboot to disable cgroups v1' | ||||||
|   when: |   when: | ||||||
|     - results is defined |     - ansible_system == 'Linux' | ||||||
|     - results.stdout is defined |     - ensure_podman is defined | ||||||
|     - ' "systemd.unified_cgroup_hierarchy=0" in results.stdout ' |     - ansible_distribution == 'Fedora' | ||||||
|  |     - ansible_distribution_major_version is version('32', '>=') | ||||||
|  |     - ansible_cmdline is defined | ||||||
|  |     - ansible_cmdline['systemd.unified_cgroup_hierarchy'] is defined | ||||||
|   reboot: |   reboot: | ||||||
| - name: 'flush handlers' | - name: 'flush handlers' | ||||||
|   meta: 'flush_handlers' |   meta: 'flush_handlers' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user