mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
28 lines
1.0 KiB
YAML
28 lines
1.0 KiB
YAML
---
|
|
- 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:
|
|
- "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: "{{ airgap_dir is not defined }}"
|
|
state: present
|
|
when: "ansible_distribution_version is version('20.10', '>=') and ansible_distribution_version is version('24.04', '<')"
|