Browse Source

use swapon -s (#4216)

pull/4238/head
hikoz 5 years ago
committed by Kubernetes Prow Robot
parent
commit
e03588f431
1 changed files with 7 additions and 2 deletions
  1. 9
      roles/kubernetes/preinstall/tasks/0010-swapoff.yml

9
roles/kubernetes/preinstall/tasks/0010-swapoff.yml

@ -8,6 +8,11 @@
- 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: swapoff -a
when: ansible_swaptotal_mb > 0
command: /sbin/swapoff -a
when: swapon.stdout != ""
Loading…
Cancel
Save