# TASK \[elastic.elasticsearch : fail when heap size is not specified when using memory lock\]

**URL:** <https://discuss.elastic.co/t/task-elastic-elasticsearch-fail-when-heap-size-is-not-specified-when-using-memory-lock/217560>\
**Category:** Elasticsearch\
**Created:** [February 3, 2020, 5:22am UTC](https://discuss.elastic.co/t/task-elastic-elasticsearch-fail-when-heap-size-is-not-specified-when-using-memory-lock/217560 "2020-02-03T05:22:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mudricd](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mudricd](https://discuss.elastic.co/u/mudricd)\
**Post date:** [February 3, 2020, 5:22am UTC](https://discuss.elastic.co/t/task-elastic-elasticsearch-fail-when-heap-size-is-not-specified-when-using-memory-lock/217560/1 "2020-02-03T05:22:16Z")

</div>

Hi,

I am trying to configure Elasticsearch cluster over Ansible. I use official Elastic Ansible role elastic.elasticsearch for this. Unfortunatelly my set up keep failing with the following error:

```auto
TASK [elastic.elasticsearch : fail when heap size is not specified when using memory lock] ***********************************************************************************************************************************************************************************
fatal: [3.92.198.97]: FAILED! => {"msg": "The conditional check 'es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined' failed. The error was: error while evaluating conditional (es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined): 'tag_Group_Elasticsearch' is undefined\n\nThe error appears to be in '/root/elastic/roles/elastic.elasticsearch/tasks/elasticsearch-parameters.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n#If the user attempts to lock memory they must specify a heap size\n- name: fail when heap size is not specified when using memory lock\n ^ here\n"}
fatal: [34.229.212.176]: FAILED! => {"msg": "The conditional check 'es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined' failed. The error was: error while evaluating conditional (es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined): 'tag_Group_Elasticsearch' is undefined\n\nThe error appears to be in '/root/elastic/roles/elastic.elasticsearch/tasks/elasticsearch-parameters.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n#If the user attempts to lock memory they must specify a heap size\n- name: fail when heap size is not specified when using memory lock\n ^ here\n"}

```

And my config is as follows:

```auto
---
- name: Install packages
  hosts: all
  become: true
  tasks:
  - name: Install packages
    yum:
      name: "{{ packages }}"
      state: present
    vars:
      packages:
        - htop
        - nmap

- name: Elasticsearch srv01 set up
  hosts: tag_Group_Elasticsearch
  roles:
    - role: elastic.elasticsearch
  vars:
    es_heap_size: "512m"
    es_config:
      network.host: 0.0.0.0
      cluster.name: "test-cluster"
      cluster.initial_master_nodes: "{{ tag_Group_Elasticsearch }}"
      discovery.seed_hosts: "{{ tag_Group_Elasticsearch }}"
      http.port: 9200
      node.master: true
      bootstrap.memory_lock: false
    es_plugins:
     - plugin: ingest-attachment

```

As you can see from above, bootstrap memory lock is configured to false but I am keep getting this error...

Any help would be much appreciated.

Cheers,  
Dragan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 2, 2020, 5:22am UTC](https://discuss.elastic.co/t/task-elastic-elasticsearch-fail-when-heap-size-is-not-specified-when-using-memory-lock/217560/2 "2020-03-02T05:22:17Z")

</div>

Closed on March 2, 2020, 5:22am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
