Skip to content

Commit

Permalink
Fixed Raspbian detection on 64-bit kernel, only reboot Raspbian if ne…
Browse files Browse the repository at this point in the history
…eded
  • Loading branch information
JohnTheNerd committed Jul 30, 2020
1 parent 9ff2744 commit 01de348
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions roles/raspbian/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
( 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
register: cgroup
when:
- raspbian is true

- name: Flush iptables before changing to iptables-legacy
iptables:
Expand All @@ -36,4 +39,7 @@

- name: Rebooting
reboot:
when: raspbian
when:
- cgroup.changed
tags:
- skip_ansible_lint

0 comments on commit 01de348

Please sign in to comment.