From 22f997f7fa342cef055dc2e82a81aabd40575987 Mon Sep 17 00:00:00 2001 From: cloudnull Date: Tue, 19 Feb 2019 13:09:42 -0600 Subject: [PATCH] Ensure upper and lower memory limits are whole numbers This change will ensure that the upper and lower memory limits are set to whole numbers when dynamically setting the memory limits. Before this change a memory limit could be a float, and in certain versions of ansible + python the option could evaluate to 0, which would break everything. Change-Id: Ibfb8af60db6566937cbf77243b0e6848d542665d Signed-off-by: cloudnull --- elk_metrics_6x/vars/variables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elk_metrics_6x/vars/variables.yml b/elk_metrics_6x/vars/variables.yml index ce572da9..f751f2d7 100644 --- a/elk_metrics_6x/vars/variables.yml +++ b/elk_metrics_6x/vars/variables.yml @@ -1,6 +1,6 @@ --- -elastic_memory_lower_limit: "{{ (ansible_memtotal_mb | int) * 0.15 // 1 }}" -elastic_memory_upper_limit: "{{ (ansible_memtotal_mb | int) * 0.35 // 1 }}" +elastic_memory_lower_limit: "{{ (((ansible_memtotal_mb | int) * 0.15) // 1) | int }}" +elastic_memory_upper_limit: "{{ (((ansible_memtotal_mb | int) * 0.35) // 1) | int }}" # Option to set persistent queue storage in gigabytes q_storage: "{{ (ansible_processor_count | int) * (ansible_processor_threads_per_core | int) * 2 }}"