ansible/roles/remove_swap/tasks/main.yml

18 lines
351 B
YAML

---
- name: Disable swap
block:
- name: Disable swap
become: true
ansible.builtin.command: "swapoff -a"
when: ansible_swaptotal_mb > 0
- name: Remove swap entry from fstab
become: true
mount:
name: "{{ item }}"
fstype: swap
state: absent
with_items:
- swap
- none