From: Sébastien Han Date: Thu, 15 Jan 2015 10:42:51 +0000 (+0100) Subject: Ability to disable swap X-Git-Tag: v1.0.0~270^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F186%2Fhead;p=ceph-ansible.git Ability to disable swap With enough memory we will probably not need any swap. Signed-off-by: Sébastien Han --- diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 40733433c..5f4741237 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -124,6 +124,7 @@ radosgw: false # referenced in monitor role too. ########### disable_transparent_hugepage: true +disable_swap: true os_tuning_params: - { name: kernel.pid_max, value: 4194303 } - { name: fs.file-max, value: 26234859 } diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/os_tuning.yml index f920882c5..7bf05f4f5 100644 --- a/roles/ceph-common/tasks/os_tuning.yml +++ b/roles/ceph-common/tasks/os_tuning.yml @@ -5,8 +5,13 @@ - name: Disable transparent hugepage command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled" - ignore_errors: true when: disable_transparent_hugepage + ignore_errors: true + +- name: Disable swap + command: swapoff -a + when: disable_swap + ignore_errors: true - name: Apply OS tuning sysctl: >