Merge "configure-swap: Always use dd and limit swap size to 1024MB"
This commit is contained in:
commit
d68d355170
|
@ -1,2 +1,2 @@
|
|||
# Default swap partition/file size, in MiB
|
||||
configure_swap_size: 8192
|
||||
configure_swap_size: 1024
|
||||
|
|
|
@ -20,21 +20,12 @@
|
|||
# Note, we don't use a sparse device to avoid wedging when disk space
|
||||
# and memory are both unavailable.
|
||||
|
||||
# Cannot fallocate on filesystems like XFS, so use slower dd
|
||||
- name: Create swap backing file for non-EXT fs
|
||||
when: '"ext" not in root_filesystem'
|
||||
- name: Create swap backing file
|
||||
become: yes
|
||||
command: dd if=/dev/zero of=/root/swapfile bs=1M count={{ swap_required }}
|
||||
args:
|
||||
creates: /root/swapfile
|
||||
|
||||
- name: Create sparse swap backing file for EXT fs
|
||||
when: '"ext" in root_filesystem'
|
||||
become: yes
|
||||
command: fallocate -l {{ swap_required }}M /root/swapfile
|
||||
args:
|
||||
creates: /root/swapfile
|
||||
|
||||
- name: Ensure swapfile perms
|
||||
become: yes
|
||||
file:
|
||||
|
|
Loading…
Reference in New Issue