From 48299e2863e482f201f849aebbb3bf1cbaceb1ce Mon Sep 17 00:00:00 2001
From: kaali09 <kaliraja1992@gmail.com>
Date: Thu, 9 Jan 2020 14:28:47 +0530
Subject: [PATCH] DO-2059 updated the syntaz error

---
 ansible/roles/log-es6/defaults/main.yml                  | 2 +-
 ansible/roles/log-es6/tasks/elasticsearch-config.yml     | 4 ++--
 ansible/roles/log-es6/tasks/elasticsearch-parameters.yml | 2 +-
 ansible/roles/log-es6/templates/jvm.options.j2           | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ansible/roles/log-es6/defaults/main.yml b/ansible/roles/log-es6/defaults/main.yml
index 799e54c30..13f752415 100644
--- a/ansible/roles/log-es6/defaults/main.yml
+++ b/ansible/roles/log-es6/defaults/main.yml
@@ -33,7 +33,7 @@ es_api_host: "localhost"
 es_api_port: 9200
 es_debian_startup_timeout: 10
 env_dir: /etc/default
-log-es_heap_size: "2g"
+log_es_heap_size: "2g"
 # Since ansible 2.2 the following variables need to be defined
 # to allow the role to be conditionally played with a when condition.
 pid_dir: ''
diff --git a/ansible/roles/log-es6/tasks/elasticsearch-config.yml b/ansible/roles/log-es6/tasks/elasticsearch-config.yml
index 6c22d50a5..437b86213 100644
--- a/ansible/roles/log-es6/tasks/elasticsearch-config.yml
+++ b/ansible/roles/log-es6/tasks/elasticsearch-config.yml
@@ -71,8 +71,8 @@
 
 - name: Get information on the RAM
   set_fact:
-    log-es_heap_size: "{% if ((ansible_memory_mb.real.total/(2*1024))|int) > 26 %}26g{% else %}{{(((ansible_memory_mb.real.total/(2*1024))+1)|int)}}g{% endif %}"
-  when: log-es_heap_size is not defined
+    log_es_heap_size: "{% if ((ansible_memory_mb.real.total/(2*1024))|int) > 26 %}26g{% else %}{{(((ansible_memory_mb.real.total/(2*1024))+1)|int)}}g{% endif %}"
+  when: log_es_heap_size is not defined
 
 - name: Copy jvm.options File for Instance
   become: yes
diff --git a/ansible/roles/log-es6/tasks/elasticsearch-parameters.yml b/ansible/roles/log-es6/tasks/elasticsearch-parameters.yml
index 6a2cf250c..779aabb6d 100644
--- a/ansible/roles/log-es6/tasks/elasticsearch-parameters.yml
+++ b/ansible/roles/log-es6/tasks/elasticsearch-parameters.yml
@@ -23,7 +23,7 @@
 #If the user attempts to lock memory they must specify a heap size
 - name: fail when heap size is not specified when using memory lock
   fail: msg="If locking memory with bootstrap.memory_lock a heap size must be specified"
-  when: es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and log-es_heap_size is not defined
+  when: es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and log_es_heap_size is not defined
 
 #Check if working with security we have an es_api_basic_auth_username and es_api_basic_auth_username - otherwise any http calls wont work
 - name: fail when api credentials are not declared when using security
diff --git a/ansible/roles/log-es6/templates/jvm.options.j2 b/ansible/roles/log-es6/templates/jvm.options.j2
index aa1c8992c..1e5332316 100644
--- a/ansible/roles/log-es6/templates/jvm.options.j2
+++ b/ansible/roles/log-es6/templates/jvm.options.j2
@@ -18,9 +18,9 @@
 
 # Xms represents the initial size of total heap space
 # Xmx represents the maximum size of total heap space
-{% if log-es_heap_size is defined %}
--Xms{{ log-es_heap_size }}
--Xmx{{ log-es_heap_size }}
+{% if log_es_heap_size is defined %}
+-Xms{{ log_es_heap_size }}
+-Xmx{{ log_es_heap_size }}
 {% else %}
 -Xms2g
 -Xmx2g
-- 
GitLab