add swap role

This commit is contained in:
Ryan Cavicchioni 2022-08-30 07:51:17 -05:00
parent 49be68b4db
commit 04dfdbd399
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
swap_enabled: true
swap_file_path: /swapfile

View 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