mirror of https://github.com/k3s-io/k3s
Merge pull request #513 from tamsky/ansible/improve-raspbian-checks
Ansible: Test for Raspbian before assumingpull/545/head
commit
7069d51b5e
|
@ -1,14 +1,24 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
|
- name: Test for Raspbian
|
||||||
|
stat:
|
||||||
|
path: /boot/cmdline.txt
|
||||||
|
register: cmdline
|
||||||
|
|
||||||
- name: Activating cgroup on Raspbian
|
- name: Activating cgroup on Raspbian
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /boot/cmdline.txt
|
path: /boot/cmdline.txt
|
||||||
regexp: '^(.*rootwait)$'
|
regexp: '^(.*rootwait)$'
|
||||||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
|
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
|
||||||
backrefs: true
|
backrefs: true
|
||||||
when: ( ansible_facts.architecture is search "arm" )
|
when: ( cmdline.stat.path is defined )
|
||||||
|
and
|
||||||
|
( ansible_facts.architecture is search("arm") )
|
||||||
|
register: boot_cmdline
|
||||||
|
|
||||||
- name: Rebooting on Raspbian
|
- name: Rebooting on Raspbian
|
||||||
shell: reboot now
|
shell: reboot now
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: ( ansible_facts.architecture is search "arm" )
|
when: ( boot_cmdline | changed )
|
||||||
|
and
|
||||||
|
( ansible_facts.architecture is search("arm") )
|
||||||
|
|
Loading…
Reference in New Issue