Skip to content

Commit 5a91f3b

Browse files
xtruthxwidhalmttbauriedel
authored
add new variable for extra configuratuon in elasticsearch.yml (#299)
Close #298 --------- Co-authored-by: Thomas Widhalm <thomas.widhalm@netways.de> Co-authored-by: Tobias Bauriedel <tobias@bauriedel.de>
1 parent ba6e5aa commit 5a91f3b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

docs/role-elasticsearch.md

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ Role Variables
3232
* *elasticsearch_check_calculation*: End play in checks (Default: `false`)
3333
* *elasticsearch_network_host*: You can configure multipe network addresses where the networking is bind to. You can assign IP addresses or interfaces by their names. You can also use elasticsearch internal variabels as it set as default. Example: `"_ens190_,_local_"` (Default: `"_local_,"_site_"`) (Optional; if not defined `default` is used)
3434

35+
* *elasticsearch_extra_config*: You can set additional configuration in YAML-notation as you would write in the `elasaticsearch.yml`. Example:
36+
37+
```YAML
38+
...
39+
elasticsearch_extra_config:
40+
xpack.security.authc.token.enabled: true
41+
42+
xpack.security.authc.realms:
43+
native.native1:
44+
order: 0
45+
enabled: true
46+
```
47+
3548
This variable activates a workaround to start on systems that have certain hardening measures active. See [Stackoverflow](https://stackoverflow.com/questions/47824643/unable-to-load-jna-native-support-library-elasticsearch-6-x/50371992#50371992) for details and logmessages to look for. **WARNING**: This will change your `/etc/sysconfig/elasticseach`or `/etc/default/elasticsearch` file and overwrite `ES_JAVA_OPTS`. See this [issue](https://github.com/netways/ansible-role-elasticsearch/issues/79) for details.
3649

3750
* *elasticsearch_jna_workaround*: Activate JNA workaround. (default: `false`)

roles/elasticsearch/templates/elasticsearch.yml.j2

+4
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,7 @@ path:
7575

7676
{% endfor %}
7777
{% endif %}
78+
79+
{% if elasticsearch_extra_config is defined %}
80+
{{ elasticsearch_extra_config | to_nice_yaml(indent=2, sort_keys=False) }}
81+
{% endif %}

0 commit comments

Comments
 (0)