--- - name: "Disable | disable swap" changed_when: false ansible.builtin.command: cmd: swapoff -a - name: "Disable | ensure swap file doesn't exist" ansible.builtin.file: path: "{{ swapfile_path }}" state: absent