From 224737f24e0852ddb770d2c7d91ec24c5102df94 Mon Sep 17 00:00:00 2001 From: Duncan Martin Walker Date: Mon, 10 Feb 2020 18:29:48 +0000 Subject: [PATCH] Exposed Kibana elastic endpoint Kibana can currently only be deployed alongside an elasticsearch coordinator node, so that it can query the cluster directly. However, in certain situations it can be useful to keep kibana separate from elasticsearch for e.g. resource reasons. This change allows the user to deploy Kibana with a list of remote endpoints that it can use to query the elastic cluster, such that no local install is required. The default behaviour is unchanged, as the default endpoint remains the localhost. Change-Id: Ic99b9aafd1d70b99d2088a4017e58079b5124ddc --- elk_metrics_7x/roles/elastic_kibana/defaults/main.yml | 5 +++++ elk_metrics_7x/roles/elastic_kibana/templates/kibana.yml.j2 | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/elk_metrics_7x/roles/elastic_kibana/defaults/main.yml b/elk_metrics_7x/roles/elastic_kibana/defaults/main.yml index 064c93a4..ad3e0081 100644 --- a/elk_metrics_7x/roles/elastic_kibana/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_kibana/defaults/main.yml @@ -25,6 +25,11 @@ kibana_server_name: "{{ ansible_hostname }}" kibana_index_on_elasticsearch: "http://{{ hostvars[groups['elastic-logstash'][0]]['ansible_host'] }}:{{ elastic_port}}/.kibana" kibana_elastic_request_timeout: 1800000 +# If unset, the protocol and port default to http and elastic_port +# respectively +kibana_elastic_endpoints: + - "http://127.0.0.1:{{ elastic_port }}" + # The following must be set in order to to allow kibana load balancing # otherwise they are set individually per Kibana instance # The key used to encrypt Elasticsearch reports diff --git a/elk_metrics_7x/roles/elastic_kibana/templates/kibana.yml.j2 b/elk_metrics_7x/roles/elastic_kibana/templates/kibana.yml.j2 index 00b08b22..460e5fb7 100644 --- a/elk_metrics_7x/roles/elastic_kibana/templates/kibana.yml.j2 +++ b/elk_metrics_7x/roles/elastic_kibana/templates/kibana.yml.j2 @@ -25,7 +25,7 @@ server.host: {{ kibana_interface }} #server.name: "your-hostname" # The URLs of the Elasticsearch instances to use for all your queries. -elasticsearch.hosts: "http://127.0.0.1:{{ elastic_port }}" +elasticsearch.hosts: {{ kibana_elastic_endpoints | to_json }} # When this setting's value is true Kibana uses the hostname specified in the server.host # setting. When the value of this setting is false, Kibana uses the hostname of the host