forked from elastic/ansible-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelasticsearch.yml.j2
82 lines (69 loc) · 3.15 KB
/
elasticsearch.yml.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{% if es_config %}
{{ es_config | to_nice_yaml(indent=2) }}
{% 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 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 %}
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: "{{ es_ssl_verification_mode }}"
{% if es_ssl_keystore and es_ssl_truststore %}
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 }}"
{% elif es_ssl_key and es_ssl_certificate %}
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 %}
xpack.security.transport.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
{% endif %}
{% endif %}
{% endif %}
{% if es_enable_http_ssl and es_enable_auto_ssl_configuration %}
xpack.security.http.ssl.enabled: true
{% if es_ssl_keystore and es_ssl_truststore %}
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 }}"
{% elif es_ssl_key and es_ssl_certificate %}
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 }}"
{% if es_ssl_certificate_authority %}
xpack.security.http.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
{% 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 %}