From: Dimitri Savineau Date: Fri, 8 Jan 2021 22:31:03 +0000 (-0500) Subject: ceph-osd: replace sysctl command task by slurp X-Git-Tag: v6.0.0alpha5~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3f64ced36b7857c225861c2388f1e3e3a2747d26;p=ceph-ansible.git ceph-osd: replace sysctl command task by slurp Instead of using the command module for retrieving a sysctl value then we can use the slurp module and read the value directly from /proc. Signed-off-by: Dimitri Savineau --- diff --git a/roles/ceph-osd/tasks/system_tuning.yml b/roles/ceph-osd/tasks/system_tuning.yml index 86a157a8d..78d8d2dbd 100644 --- a/roles/ceph-osd/tasks/system_tuning.yml +++ b/roles/ceph-osd/tasks/system_tuning.yml @@ -37,15 +37,13 @@ when: disable_transparent_hugepage | bool - name: get default vm.min_free_kbytes - command: sysctl -b vm.min_free_kbytes - changed_when: false - failed_when: false - check_mode: no + slurp: + src: /proc/sys/vm/min_free_kbytes register: default_vm_min_free_kbytes - name: set_fact vm_min_free_kbytes set_fact: - vm_min_free_kbytes: "{{ 4194303 if ansible_memtotal_mb >= 49152 else default_vm_min_free_kbytes.stdout }}" + vm_min_free_kbytes: "{{ 4194303 if ansible_memtotal_mb >= 49152 else default_vm_min_free_kbytes.content | b64decode | trim }}" - name: apply operating system tuning sysctl: