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 <dsavinea@redhat.com>
pull/6143/head
Dimitri Savineau 2021-01-08 17:31:03 -05:00 committed by Guillaume Abrioux
parent ed9f0641ee
commit 3f64ced36b
1 changed files with 3 additions and 5 deletions

View File

@ -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: