From f664580ce6e627f88c280213f04547e65a9bf679 Mon Sep 17 00:00:00 2001 From: Dale McDiarmid Date: Wed, 11 Jan 2017 13:16:07 +0000 Subject: [PATCH] Ability to disable x-pack features --- README.md | 6 +++++- defaults/main.yml | 2 +- templates/elasticsearch.yml.j2 | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 848804c..709d806 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,11 @@ ansible-playbook -i hosts ./your-playbook.yml ### Installing X-Pack Features -X-Pack features, such as Security, are supported. This feature is currently experimental. To enable X-Pack set the parameter `es_enable_xpack` to true and list the required features in the parameter `es_xpack_features`. The following additional parameters allow X-Pack to be configured: +X-Pack features, such as Security, are supported. This feature is currently experimental. To enable X-Pack set the parameter `es_enable_xpack` to true and list the required features in the parameter `es_xpack_features`. + +The parameter `es_xpack_features` by default enables all features i.e. it defaults to ["alerting","monitoring","graph","security","reporting"] + +The following additional parameters allow X-Pack to be configured: * ```es_message_auth_file``` System Key field to allow message authentication. This file should be placed in the 'files' directory. * ```es_role_mapping``` Role mappings file declared as yml as described [here](https://www.elastic.co/guide/en/x-pack/current/mapping-roles.html) diff --git a/defaults/main.yml b/defaults/main.yml index faaffc5..84b4779 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,7 +24,7 @@ es_work_dir: "/tmp/elasticsearch" es_max_open_files: 65536 es_allow_downgrades: false es_enable_xpack: false -es_xpack_features: [] +es_xpack_features: ["alerting","monitoring","graph","security","reporting"] #These are used for internal operations performed by ansible. #They do not effect the current configuration es_api_host: "localhost" diff --git a/templates/elasticsearch.yml.j2 b/templates/elasticsearch.yml.j2 index d6755ae..fb57827 100644 --- a/templates/elasticsearch.yml.j2 +++ b/templates/elasticsearch.yml.j2 @@ -23,3 +23,19 @@ path.work: {{ work_dir }} {% endif %} path.logs: {{ log_dir }} + +{% if not "security" in es_xpack_features %} +xpack.security.enabled: false +{% endif %} + +{% if not "monitoring" in es_xpack_features %} +xpack.monitoring.enabled: false +{% endif %} + +{% if not "alerting" in es_xpack_features %} +xpack.watcher.enabled: false +{% endif %} + +{% if not "reporting" in es_xpack_features %} +xpack.reporting.enabled: false +{% endif %} \ No newline at end of file