From 891ca42a79d6e0c8e6c8d15d78bc9e658b08b1f7 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Mon, 21 Jul 2025 15:49:44 +0200 Subject: [PATCH] feat: properly remove swap --- tasks/swap.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks/swap.yaml b/tasks/swap.yaml index ca834ee..f3d276c 100644 --- a/tasks/swap.yaml +++ b/tasks/swap.yaml @@ -67,7 +67,7 @@ when: "swap_file_check.stat.exists and not __swap" # configure fstab - - name: "swap - configure fstab" + - name: "swap - configure fstab - part 1" ansible.posix.mount: name: "swapfile" src: "{{ swap_file_location | default('/swapfile') }}" @@ -77,3 +77,11 @@ dump: "0" state: "absent" when: "not __swap" + + # configure fstab + - name: "swap - configure fstab - part 2" + ansible.builtin.lineinfile: + path: "/etc/fstab" + regexp: "swap" + state: "absent" + when: "not __swap"