Skip to content

Commit

Permalink
Merge pull request #63 from JohnTheNerd/master
Browse files Browse the repository at this point in the history
Fixed Raspbian detection on 64-bit kernel, made reboot only do so if needed
  • Loading branch information
St0rmingBr4in authored Aug 5, 2020
2 parents 9ff2744 + 05ade9a commit 09a68c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions roles/raspbian/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: reboot
reboot:
12 changes: 6 additions & 6 deletions roles/raspbian/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@
( ansible_facts.architecture is search("arm") and
ansible_facts.lsb.description is match("[Rr]aspbian.*[Bb]uster") ) or
( ansible_facts.architecture is search("aarch64") and
ansible_facts.lsb.description is match("Debian.*buster") ) %}True{% else %}False{% endif %}'
ansible_facts.lsb.description is match("Debian.*buster") or
ansible_facts.lsb.description is match("[Rr]aspbian.*[Bb]uster") ) %}true{% else %}false{% endif %}'

- 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
when: raspbian
notify: reboot
when:
- raspbian is true

- name: Flush iptables before changing to iptables-legacy
iptables:
flush: true
when: raspbian
changed_when: false # iptables flush always returns changed

- name: Changing to iptables-legacy
alternatives:
Expand All @@ -33,7 +37,3 @@
name: ip6tables
register: ip6_legacy
when: raspbian

- name: Rebooting
reboot:
when: raspbian

0 comments on commit 09a68c3

Please sign in to comment.