From 59b9aef5870121b5302bdfe57e489fa30d0e8c44 Mon Sep 17 00:00:00 2001 From: Thomas Widhalm Date: Fri, 8 Sep 2023 12:31:48 +0200 Subject: [PATCH] Add "extra config" to `kibana.yml` (#270) fixes #208 --- docs/role-kibana.md | 1 + molecule/elasticstack_default/converge.yml | 2 ++ roles/kibana/templates/kibana.yml.j2 | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/docs/role-kibana.md b/docs/role-kibana.md index 07d17653..0581b9ff 100644 --- a/docs/role-kibana.md +++ b/docs/role-kibana.md @@ -13,6 +13,7 @@ Role Variables * *kibana_tls*: Whether to offer `https` for clients or not (default: `false`) * *kibana_tls_cert*: Path to the certificate Kibana should show to its clients (default: `/etc/kibana/certs/cert.pem`) * *kibana_tls_key*: Path to the key Kibana should use when communicating with clients (default: `/etc/kibana/certs/key.pem`) +* *kibana_extra_config*: You can add arbitraty configuration options with this option. Just start it with `|-` and indent the following lines. So you can add as many lines and options to `kibana.yml` as you like. (default: none) * *kibana_security*: Activate TLS and authentication when connecting to Elasticsearch. **Note**: Only works when `elasticstack_full_stack` is enabled. (default: `true`) diff --git a/molecule/elasticstack_default/converge.yml b/molecule/elasticstack_default/converge.yml index 718dc256..35dd7f8e 100644 --- a/molecule/elasticstack_default/converge.yml +++ b/molecule/elasticstack_default/converge.yml @@ -23,6 +23,8 @@ - system beats_fields: - "testbed: molecule" + kibana_extra_config: |- + ops.interval: 5000 tasks: - name: Enable Elastic installation on RHEL 9 ansible.builtin.set_fact: diff --git a/roles/kibana/templates/kibana.yml.j2 b/roles/kibana/templates/kibana.yml.j2 index eedc5018..b401caa0 100644 --- a/roles/kibana/templates/kibana.yml.j2 +++ b/roles/kibana/templates/kibana.yml.j2 @@ -30,3 +30,7 @@ server.ssl.enabled: true server.ssl.certificate: "{{ kibana_tls_cert }}" server.ssl.key: "{{ kibana_tls_key }}" {% endif %} + +{% if kibana_extra_config is defined %} +{{ kibana_extra_config }} +{% endif %}