Add a role to reconfigure raspberry pi swap
This commit is contained in:
parent
0f62ef5fbb
commit
4b3b6cacf8
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
rpi_swap_size: 1024
|
||||
rpi_swap_reboot: true
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
- name: swapoff the current swap file
|
||||
command: dphys-swapfile swapoff
|
||||
|
||||
- name: set the swap size to {{ rpi_swap_size }}
|
||||
lineinfile:
|
||||
path: /etc/dphys-swapfile
|
||||
regexp: "^CONF_SWAPSIZE"
|
||||
line: "CONF_SWAPSIZE={{ rpi_swap_size }}"
|
||||
|
||||
- name: re-initialize swap file
|
||||
command: dphys-swapfile setup
|
||||
|
||||
- name: swapon the swap file
|
||||
command: dphys-swapfile swapon
|
||||
|
||||
- name: reboot the raspberry pi
|
||||
command: reboot
|
||||
when: rpi_swap_reboot
|
Loading…
Reference in New Issue