Skip to content

Commit

Permalink
Handle both new and old cmdline.txt locations in Raspbian (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Sep 13, 2024
1 parent bc03d1c commit 848e22c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion roles/raspberrypi/tasks/prereq/Raspbian.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 848e22c

Please sign in to comment.