mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
* More flexible cgroup settings If there are already required cgroup boot parameters present but in a different order than specified, the script will add them again. It is better to test for the individual parameter in a loop and selectively add them as necessary. Signed-off-by: Marko Vukovic <anonsoftware@gmail.com> Signed-off-by: Marko Vukovic <anonsoftware@gmail.com> Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
24 lines
853 B
YAML
24 lines
853 B
YAML
---
|
|
- name: Enable cgroup via boot commandline if not already enabled
|
|
when: lookup('fileglob', '/boot/firmware/cmdline.txt', errors='warn') | length > 0
|
|
ansible.builtin.replace:
|
|
path: /boot/firmware/cmdline.txt
|
|
regexp: '^([\w](?!.*\b{{ cgroup_item }}\b).*)$'
|
|
replace: '\1 {{ cgroup_item }}'
|
|
with_items:
|
|
- "cgroup_enable=cpuset"
|
|
- "cgroup_memory=1"
|
|
- "cgroup_enable=memory"
|
|
loop_control:
|
|
loop_var: cgroup_item
|
|
notify: Reboot Pi
|
|
|
|
- name: Install Ubuntu Raspi Extra Packages
|
|
ansible.builtin.apt:
|
|
# Fixes issues in newer Ubuntu where VXLan isn't setup right.
|
|
# See: https://github.com/k3s-io/k3s/issues/4234
|
|
name: linux-modules-extra-raspi
|
|
update_cache: true
|
|
state: present
|
|
when: "ansible_distribution_version is version('20.10', '>=') and ansible_distribution_version is version('24.04', '<')"
|