From 47b16b3c20b3f85e68e0d44f0644f176152b56d3 Mon Sep 17 00:00:00 2001 From: Manuel Gutierrez Date: Thu, 26 Sep 2019 16:32:57 +0200 Subject: [PATCH] Support both IP and DNS when creating elastic cluster --- .../ansible-elasticsearch/templates/instances.yml.j2 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/roles/elastic-stack/ansible-elasticsearch/templates/instances.yml.j2 b/roles/elastic-stack/ansible-elasticsearch/templates/instances.yml.j2 index c74b1700..62182293 100644 --- a/roles/elastic-stack/ansible-elasticsearch/templates/instances.yml.j2 +++ b/roles/elastic-stack/ansible-elasticsearch/templates/instances.yml.j2 @@ -4,10 +4,14 @@ {% if node_certs_generator %} instances: -{% for (key,value) in instances.iteritems() %} -- name: "{{ value.name }}" +{% for (key,value) in instances.items() %} +- name: "{{ value.name }}" +{% if value.ip %} ip: - "{{ value.ip }}" -{% endfor %} - +{% elif value.dns %} + dns: + - "{{ value.dns }}" +{% endif %} +{% endfor %} {% endif %}