Skip to content

Commit

Permalink
Switch boot options location based on distro.
Browse files Browse the repository at this point in the history
In RaspiOS the boot options are specified in
`/boot/firmware/cmdline.txt`, but in the TPi-provided Ubuntu image for
the RK1 they're in `/boot/firmware/ubuntuEnv.txt`.

There are various ways this could be done, but this is probably the
simplest. We could also split this out into a distro-specific file and
also set `ansible_user` there; at the moment I'm handling this in
`hosts.ini` and `group_vars`.
  • Loading branch information
jamestait committed Feb 15, 2024
1 parent 24d7951 commit f12ace6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Set up cluster-wide configuration.
hosts: cluster
gather_facts: false
gather_facts: true
become: true

handlers:
Expand All @@ -26,6 +26,18 @@
- "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
regexp: '^(bootargs=[\w](?!.*\b{{ item }}\b).*)$'
replace: '\1 {{ item }}'
with_items:
- "cgroup_memory=1"
- "cgroup_enable=memory"
notify: reboot-pi
when: ansible_distribution == 'Ubuntu'

- name: Download K3s install script.
ansible.builtin.get_url:
Expand Down

0 comments on commit f12ace6

Please sign in to comment.