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