Handle both new and old cmdline.txt locations in Raspbian

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/362/head
Derek Nola 2024-09-12 10:00:09 -07:00
parent bc03d1c0d0
commit f9b8ff9143
No known key found for this signature in database
GPG Key ID: 5E741CE7ED12510E
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,12 @@
---
- name: Check if /boot/firmware/cmdline.txt exists
ansible.builtin.stat:
path: /boot/firmware/cmdline.txt
register: boot_firmware_cmdline_txt
- name: Enable cgroup via boot commandline if not already enabled
ansible.builtin.replace:
path: /boot/cmdline.txt
path: "{{ (boot_firmware_cmdline_txt.stat.exists) | ternary('/boot/firmware/cmdline.txt', '/boot/cmdline.txt') }}"
regexp: '^([\w](?!.*\b{{ cgroup_item }}\b).*)$'
replace: '\1 {{ cgroup_item }}'
with_items: