mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
moved raspberry specific settings to raspberrypi role
This commit is contained in:
25
roles/raspberrypi/tasks/prereq/Raspbian.yml
Normal file
25
roles/raspberrypi/tasks/prereq/Raspbian.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Activating cgroup support
|
||||
lineinfile:
|
||||
path: /boot/cmdline.txt
|
||||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$'
|
||||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
|
||||
backrefs: true
|
||||
notify: reboot
|
||||
|
||||
- name: Flush iptables before changing to iptables-legacy
|
||||
iptables:
|
||||
flush: true
|
||||
changed_when: false # iptables flush always returns changed
|
||||
|
||||
- name: Changing to iptables-legacy
|
||||
alternatives:
|
||||
path: /usr/sbin/iptables-legacy
|
||||
name: iptables
|
||||
register: ip4_legacy
|
||||
|
||||
- name: Changing to ip6tables-legacy
|
||||
alternatives:
|
||||
path: /usr/sbin/ip6tables-legacy
|
||||
name: ip6tables
|
||||
register: ip6_legacy
|
||||
18
roles/raspberrypi/tasks/prereq/Ubuntu.yml
Normal file
18
roles/raspberrypi/tasks/prereq/Ubuntu.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Enable cgroup via boot commandline if not already enabled for Ubuntu on ARM
|
||||
lineinfile:
|
||||
path: /boot/firmware/cmdline.txt
|
||||
backrefs: yes
|
||||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$'
|
||||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
|
||||
when:
|
||||
- ansible_distribution == 'Ubuntu'
|
||||
- ( ansible_facts.architecture is search("arm") or
|
||||
ansible_facts.architecture is search("aarch64") )
|
||||
|
||||
- name: Reboot to enable cgroups for Ubuntu on ARM
|
||||
reboot:
|
||||
when:
|
||||
- ansible_distribution == 'Ubuntu'
|
||||
- ( ansible_facts.architecture is search("arm") or
|
||||
ansible_facts.architecture is search("aarch64") )
|
||||
1
roles/raspberrypi/tasks/prereq/default.yml
Normal file
1
roles/raspberrypi/tasks/prereq/default.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
Reference in New Issue
Block a user