mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-17 17:07:36 -02:30
Merge pull request #2903 from riverzhang/swap
Add manage swap on the worker node
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
---
|
||||
# Disable swap
|
||||
- import_tasks: swapoff.yml
|
||||
when: disable_swap
|
||||
|
||||
- import_tasks: verify-settings.yml
|
||||
tags:
|
||||
- asserts
|
||||
|
||||
10
roles/kubernetes/preinstall/tasks/swapoff.yml
Normal file
10
roles/kubernetes/preinstall/tasks/swapoff.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Remove swapfile from /etc/fstab
|
||||
mount:
|
||||
name: swap
|
||||
fstype: swap
|
||||
state: absent
|
||||
|
||||
- name: Disable swap
|
||||
command: swapoff -a
|
||||
when: ansible_swaptotal_mb > 0
|
||||
Reference in New Issue
Block a user