add swap role
This commit is contained in:
parent
49be68b4db
commit
04dfdbd399
3
roles/swap/defaults/main.yaml
Normal file
3
roles/swap/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
swap_enabled: true
|
||||||
|
swap_file_path: /swapfile
|
15
roles/swap/tasks/main.yaml
Normal file
15
roles/swap/tasks/main.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
- name: manage swap
|
||||||
|
command: swapoff -a
|
||||||
|
when: not swap_enabled
|
||||||
|
|
||||||
|
- name: manage swapfile
|
||||||
|
file:
|
||||||
|
path: "{{ swap_file_path }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: manage fstab
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/fstab
|
||||||
|
regexp: swap
|
||||||
|
state: absent
|
Loading…
Reference in New Issue
Block a user