From f06b042aab0e6041837d730e9727e80421a9d17c Mon Sep 17 00:00:00 2001 From: Luis Salgado Alves <97047235+lufisaal@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:31:27 +0000 Subject: [PATCH] Refactor task to add compatibility with cmdline changes on ubuntu 25 (#461) Signed-off-by: lufisaal --- roles/raspberrypi/tasks/prereq/Ubuntu.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/raspberrypi/tasks/prereq/Ubuntu.yml b/roles/raspberrypi/tasks/prereq/Ubuntu.yml index 052a4ac..ccd056f 100644 --- a/roles/raspberrypi/tasks/prereq/Ubuntu.yml +++ b/roles/raspberrypi/tasks/prereq/Ubuntu.yml @@ -1,8 +1,12 @@ --- -- name: Enable cgroup via boot commandline if not already enabled - when: lookup('fileglob', '/boot/firmware/cmdline.txt', errors='warn') | length > 0 - ansible.builtin.replace: +- 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_firmware_cmdline_txt.stat.exists) | ternary('/boot/firmware/cmdline.txt', '/boot/firmware/current/cmdline.txt') }}" regexp: '^([\w](?!.*\b{{ cgroup_item }}\b).*)$' replace: '\1 {{ cgroup_item }}' with_items: