ansible-role-elasticsearch/templates/elasticsearch.yml.j2
Julien Mailleret be7941438c
cleanup some values related to 5.x version
We can remove them since 5.x is no more supported
2019-09-16 10:46:43 +02:00

53 lines
1.5 KiB
Django/Jinja

{% if es_config %}
{{ es_config | to_nice_yaml }}
{% endif %}
{% if es_config['cluster.name'] is not defined %}
cluster.name: elasticsearch
{% endif %}
{% if es_config['node.name'] is not defined %}
node.name: {{inventory_hostname}}
{% endif %}
#################################### Paths ####################################
# Path to directory containing configuration (this file and logging.yml):
path.data: {{ es_data_dirs | array_to_str }}
path.logs: {{ es_log_dir }}
{% if es_path_repo is defined %}
path.repo: {{ es_path_repo }}
{% endif %}
{% if es_action_auto_create_index == true %}
action.auto_create_index: true
{% elif not es_action_auto_create_index %}
action.auto_create_index: false
{% else %}
action.auto_create_index: {{ es_action_auto_create_index }}
{% endif %}
{% if es_enable_xpack and es_api_basic_auth_username is defined and es_api_basic_auth_password is defined %}
xpack.security.enabled: true
{% endif %}
{% if es_mail_config is defined %}
xpack.notification.email:
account:
{{ es_mail_config['account'] }}:
profile: {{ es_mail_config['profile'] }}
email_defaults:
from: {{ es_mail_config['from'] }}
smtp:
auth: {{ es_mail_config['require_auth'] }}
host: {{ es_mail_config['host'] }}
port: {{ es_mail_config['port'] }}
{% if es_mail_config['require_auth'] == true -%}
user: {{ es_mail_config['user'] }}
password: {{ es_mail_config['pass'] }}
{%- endif %}
{% endif %}