]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-osd: replace sysctl command task by slurp
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 8 Jan 2021 22:31:03 +0000 (17:31 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 11 Jan 2021 12:24:23 +0000 (13:24 +0100)
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 <dsavinea@redhat.com>
roles/ceph-osd/tasks/system_tuning.yml

index 86a157a8d071addbc2aecd13f50f153371ee766b..78d8d2dbdd366c4c3f63a60fc8afd05494c26808 100644 (file)
   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: