Skip to content

Commit a65d969

Browse files
xtruthxwidhalmt
andauthored
make elasticsearch network.host configurable (#220)
This PR fixes #219 --------- Co-authored-by: Thomas Widhalm <[email protected]>
1 parent fb48ffd commit a65d969

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/role-elasticsearch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Role Variables
3535
* *elasticsearch_http_publish_port*: (integer) The port of the HTTP publish address. Configure this setting only if you need the publish port to be different from http.port. (default: `not set`)
3636
* *elasticsearch_pamlimits*: Set pam_limits neccessary for Elasticsearch. (Default: `true`)
3737
* *elasticsearch_check_calculation*: End play in checks (Default: `false`)
38+
* *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)
3839

3940
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.
4041

roles/elasticsearch/templates/elasticsearch.yml.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ node.name: "{{ ansible_hostname }}"
22
path.data: {{ elasticsearch_datapath }}
33
path.logs: {{ elasticsearch_logpath }}
44
cluster.name: "{{ elasticsearch_clustername }}"
5-
network.host: ["_local_","_site_"]
5+
{% if elasticsearch_network_host is defined %}
6+
network.host: [ {{ elasticsearch_network_host }} ]
7+
{% else %}
8+
network.host: [ "_local_", "_site_" ]
9+
{% endif %}
610
{% if elasticsearch_http_publish_host is defined %}
711
http.publish_host: "{{ elasticsearch_http_publish_host }}"
812
{% endif %}

0 commit comments

Comments
 (0)