add swapfile role

This commit is contained in:
Sergey Malyuk
2025-12-18 10:54:07 +03:00
parent 02d63ac131
commit d27ba46d5b
11 changed files with 216 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
---
- name: "Manage swap file entry in fstab"
ansible.posix.mount:
name: none
src: "{{ swap_file_path }}"
fstype: swap
opts: sw
state: "{{ swap_file_state }}"
- name: "Include disable swap tasks"
when: swap_file_state == 'absent'
ansible.builtin.include_tasks: disable.yml
- name: "Include enable swap tasks"
when: swap_file_state == 'present'
ansible.builtin.include_tasks: enable.yml