mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2026-03-10 12:12:12 +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: raspberrypi_boot_file
|
|
|
|
- name: Enable cgroup via boot commandline if not already enabled
|
|
ansible.builtin.replace:
|
|
path: "{{ (raspberrypi_boot_file.stat.exists) | ternary('/boot/firmware/cmdline.txt', '/boot/firmware/current/cmdline.txt') }}"
|
|
regexp: '^([\w](?!.*\b{{ cgroup_item }}\b).*)$'
|
|
replace: '\1 {{ cgroup_item }}'
|
|
loop:
|
|
- "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_facts['distribution_version'] is version('20.10', '>=') and ansible_facts['distribution_version'] is version('24.04', '<')"
|