-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Raspberry tasks for Debian (#151)
* Fix Raspberry tasks for Debian Signed-off-by: Rick <[email protected]> Signed-off-by: Rick <[email protected]> * Move debian yaml files Signed-off-by: Rick <[email protected]> Signed-off-by: Rick <[email protected]> * Add task for Debian to install iptables Signed-off-by: Rick <[email protected]> * Add check for cmdline.txt path for Debian Signed-off-by: Rick <[email protected]> * Remove Debian11 tasks file Signed-off-by: Rick <[email protected]> --------- Signed-off-by: Rick <[email protected]> Signed-off-by: Rick <[email protected]> Co-authored-by: Rick <[email protected]> Co-authored-by: Rick <[email protected]>
- Loading branch information
1 parent
8e70812
commit b65b610
Showing
2 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Check if /boot/firmware/cmdline.txt exists | ||
stat: | ||
path: /boot/firmware/cmdline.txt | ||
register: boot_firmware_cmdline_txt | ||
|
||
- name: Activating cgroup support | ||
lineinfile: | ||
path: "{{ (boot_firmware_cmdline_txt.stat.exists) | ternary('/boot/firmware/cmdline.txt', '/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: Install iptables | ||
apt: | ||
name: iptables | ||
|
||
- 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 |