Disable swap

This commit is contained in:
Ruakij 2022-11-01 08:45:48 +01:00
parent 0d2e715980
commit 7e83a43755

View File

@ -1,2 +1,10 @@
- name: Disable swap
command: swapoff -a
- name: Disable swap-mounts
replace:
path: /etc/fstab
regexp: '^([ \t]*(?!#)\S+[ \t]+swap[ \t]+.*)'
replace: '# \1'
- name: Disable active swap immediately
command: swapoff -va
changed_when: "command.stdout != ''"
register: command