Skip to content

Commit

Permalink
This prevents applying Bookworm boot file structure changes in Bullse…
Browse files Browse the repository at this point in the history
…ye systems.
  • Loading branch information
RanchoHam committed Sep 25, 2024
1 parent 4e5526e commit 0931527
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,31 @@
- config.yml

tasks:
- name: Account for Bullseye to Bookworm changes
- name: Boot changes in Debian systems
block:
- name: Set Bookworm subdirectory
- name: For Bullseye (and before) no boot sub-directory
set_fact:
sub_dir_12: "firmware/"
sub_dir: ""
when: ansible_distribution_major_version <= "11"

Check failure on line 20 in main.yml

View workflow job for this annotation

GitHub Actions / Lint

20:59 [trailing-spaces] trailing spaces

- name: For Bookworm add a boot sub-directory
set_fact:
sub_dir: "firmware/"

Check failure on line 24 in main.yml

View workflow job for this annotation

GitHub Actions / Lint

24:33 [trailing-spaces] trailing spaces
when: ansible_distribution_major_version >= "12"

Check failure on line 26 in main.yml

View workflow job for this annotation

GitHub Actions / Lint

26:1 [trailing-spaces] trailing spaces
- name: Set Bullseye (and before) sub-directory
set_fact:
sub_dir_12: ""
when: ansible_distribution_major_version <= "11"
- name: Ensure cgroups are configured correctly.
ansible.builtin.replace:
path: /boot/{{ sub_dir }}cmdline.txt
regexp: '^([\w](?!.*\b{{ item }}\b).*)$'
replace: '\1 {{ item }}'
with_items:
- "cgroup_memory=1"
- "cgroup_enable=memory"
notify: reboot-pi

- name: Ensure cgroups are configured correctly in cmdline.txt.
ansible.builtin.replace:
path: /boot/{{ sub_dir_12 }}cmdline.txt
regexp: '^([\w](?!.*\b{{ item }}\b).*)$'
replace: '\1 {{ item }}'
with_items:
- "cgroup_memory=1"
- "cgroup_enable=memory"
notify: reboot-pi
when: ansible_distribution == 'Debian'


- name: Ensure cgroups are configured correctly in ubuntuEnv.txt.
ansible.builtin.replace:
path: /boot/firmware/ubuntuEnv.txt
Expand Down

0 comments on commit 0931527

Please sign in to comment.