Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle both new and old cmdline.txt locations in Raspbian/Raspberry Pi OS #362

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading