You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
396 B

  1. ---
  2. - name: Remove swapfile from /etc/fstab
  3. mount:
  4. name: "{{ item }}"
  5. fstype: swap
  6. state: absent
  7. with_items:
  8. - swap
  9. - none
  10. # kubelet fails even if ansible_swaptotal_mb = 0
  11. - name: check swap
  12. command: /sbin/swapon -s
  13. register: swapon
  14. changed_when: no
  15. - name: Disable swap
  16. command: /sbin/swapoff -a
  17. when: swapon.stdout
  18. ignore_errors: "{{ ansible_check_mode }}"