Skip to content

Commit 322978f

Browse files
authored
Merge pull request #9 from NETWAYS/feature-singlenode-8
Disable discovery on single node clusters
2 parents b920d29 + 02aa2c6 commit 322978f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

roles/elasticsearch/templates/elasticsearch.yml.j2

+2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ node.name: "{{ ansible_hostname }}"
22
path.data: {{ elasticsearch_datapath }}
33
path.logs: /var/log/elasticsearch
44
network.host: ["_local_","_site_"]
5+
{% if elastic_release < 8 or groups['elasticsearch'] | length > 1 %}
56
discovery.seed_hosts: [ {% for host in groups['elasticsearch'] %}
67
"{{ hostvars[host].ansible_default_ipv4.address | default(hostvars[host].ansible_all_ipv4_addresses[0]) }}"{% if not loop.last %},{% endif %}
78
{% endfor %} ]
9+
{% endif %}
810
cluster.initial_master_nodes: [ {% for host in groups['elasticsearch'] %}
911
"{{ hostvars[host].ansible_hostname }}"{% if not loop.last %},{% endif %}
1012
{% endfor %} ]

0 commit comments

Comments
 (0)