moved raspberry specific settings to raspberrypi role

This commit is contained in:
Staf Wagemakers
2020-08-16 10:03:10 +02:00
parent 09a68c398f
commit 53efb429e3
6 changed files with 50 additions and 16 deletions

View 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

View 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") )

View File

@@ -0,0 +1 @@
---