diff --git a/ansible/roles/log-es6/defaults/main.yml b/ansible/roles/log-es6/defaults/main.yml
index 799e54c305dbc786542d1b74d94445e520d2e2bc..13f752415e07ed29e684277bf5209fb7a32ac835 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 6c22d50a56304f3e8c793ab437cdd4078e8f174b..437b86213f95c44d1475833a344abaf6280523ba 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 6a2cf250cbe66ef44386acaa5cc6b66ee9511db7..779aabb6d5546f34f020cbdd12f2440905d3b7a8 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 aa1c8992c819e10b67bb2372c36857d97b233ee9..1e533231603bd3eb0742ed448bdf4d0e2e621b1d 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