c12s-kubespray/roles/kubernetes/preinstall/tasks/0010-swapoff.yml
2019-02-14 02:35:17 -08:00

18 lines
358 B
YAML

---
- name: Remove swapfile from /etc/fstab
mount:
name: "{{ item }}"
fstype: swap
state: absent
with_items:
- swap
- none
# kubelet fails even if ansible_swaptotal_mb = 0
- name: check swap
command: /sbin/swapon -s
register: swapon
changed_when: no
- name: Disable swap
command: /sbin/swapoff -a
when: swapon.stdout != ""