ansible-role-elasticsearch/templates/elasticsearch.yml.j2

83 lines
3.2 KiB
Text
Raw Normal View History

{% if es_config %}
2019-11-21 11:32:20 +01:00
{{ es_config | to_nice_yaml(indent=2) }}
{% endif %}
2015-11-25 15:28:09 +00:00
{% if es_config['cluster.name'] is not defined %}
cluster.name: elasticsearch
{% endif %}
2015-11-25 15:28:09 +00:00
{% 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 }}
2017-01-11 13:16:07 +00:00
{% if es_path_repo is defined %}
path.repo: {{ es_path_repo }}
{% endif %}
2018-05-03 16:29:17 +02:00
{% 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 not oss_version and es_api_basic_auth_username is defined and es_api_basic_auth_password is defined %}
xpack.security.enabled: true
{% if es_enable_transport_ssl and es_enable_auto_ssl_configuration %}
2019-10-11 16:29:54 +01:00
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: "{{ es_ssl_verification_mode }}"
2019-10-11 16:09:05 +01:00
{% if es_ssl_keystore and es_ssl_truststore %}
2019-10-11 16:29:54 +01:00
xpack.security.transport.ssl.keystore.path: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
xpack.security.transport.ssl.truststore.path: "{{ es_ssl_certificate_path }}/{{ es_ssl_truststore | basename }}"
2019-10-12 00:03:47 +01:00
{% elif es_ssl_key and es_ssl_certificate %}
2019-10-11 16:29:54 +01:00
xpack.security.transport.ssl.key: "{{ es_ssl_certificate_path }}/{{ es_ssl_key | basename }}"
xpack.security.transport.ssl.certificate: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate | basename }}"
{% if es_ssl_certificate_authority %}
2019-10-11 16:29:54 +01:00
xpack.security.transport.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
{% endif %}
2019-10-11 16:09:05 +01:00
{% endif %}
{% endif %}
{% if es_enable_http_ssl and es_enable_auto_ssl_configuration %}
2019-10-11 16:29:54 +01:00
xpack.security.http.ssl.enabled: true
2019-10-11 16:09:05 +01:00
{% if es_ssl_keystore and es_ssl_truststore %}
2019-10-11 16:29:54 +01:00
xpack.security.http.ssl.keystore.path: "{{ es_ssl_certificate_path }}/{{ es_ssl_keystore | basename }}"
xpack.security.http.ssl.truststore.path: "{{ es_ssl_certificate_path }}/{{ es_ssl_truststore | basename }}"
2019-10-12 00:03:47 +01:00
{% elif es_ssl_key and es_ssl_certificate %}
2019-10-11 16:29:54 +01:00
xpack.security.http.ssl.key: "{{ es_ssl_certificate_path }}/{{ es_ssl_key | basename }}"
xpack.security.http.ssl.certificate: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate | basename }}"
2019-10-11 16:09:05 +01:00
{% if es_ssl_certificate_authority %}
2019-10-11 16:29:54 +01:00
xpack.security.http.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
2019-10-11 16:09:05 +01:00
{% endif %}
{% endif %}
{% endif %}
{% 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 %}