From 848e22cb72bbb6e5e5d39cccfa62b05e78539e4a Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Fri, 13 Sep 2024 10:49:53 -0700 Subject: [PATCH] Handle both new and old cmdline.txt locations in Raspbian (#362) Signed-off-by: Derek Nola --- roles/raspberrypi/tasks/prereq/Raspbian.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/raspberrypi/tasks/prereq/Raspbian.yml b/roles/raspberrypi/tasks/prereq/Raspbian.yml index cdcb4163a..8dc260da5 100644 --- a/roles/raspberrypi/tasks/prereq/Raspbian.yml +++ b/roles/raspberrypi/tasks/prereq/Raspbian.yml @@ -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: