From 3ad837a7bf51351e2c0ba896fb68f32d7080f970 Mon Sep 17 00:00:00 2001 From: Guillaume Thouvenin Date: Fri, 2 Dec 2016 10:32:57 +0100 Subject: [PATCH] Separate the configuration and other part of the client This patch separates the configuration of the client and the creation of the Kibana objects into Elasticsearch. Now we need to call the state client.service to configure the client, restart the service and then apply the client state. --- elasticsearch/{client.sls => client/init.sls} | 12 ++---------- elasticsearch/client/service.sls | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) rename elasticsearch/{client.sls => client/init.sls} (70%) create mode 100644 elasticsearch/client/service.sls diff --git a/elasticsearch/client.sls b/elasticsearch/client/init.sls similarity index 70% rename from elasticsearch/client.sls rename to elasticsearch/client/init.sls index 4c8246e..9621bbb 100644 --- a/elasticsearch/client.sls +++ b/elasticsearch/client/init.sls @@ -1,16 +1,8 @@ {%- from "elasticsearch/map.jinja" import client with context %} {%- if client.get('enabled', False) %} -/etc/salt/minion.d/_elasticsearch.conf: - file.managed: - - source: salt://elasticsearch/files/_elasticsearch.conf - - template: jinja - - user: root - - group: root - -elasticsearch_client_packages: - pkg.installed: - - names: {{ client.pkgs }} +include: + - elasticsearch.client.service {%- for index_name, index in client.get('index', {}).iteritems() %} elasticsearch_index_{{ index_name }}: diff --git a/elasticsearch/client/service.sls b/elasticsearch/client/service.sls new file mode 100644 index 0000000..66a33f8 --- /dev/null +++ b/elasticsearch/client/service.sls @@ -0,0 +1,15 @@ +{%- from "elasticsearch/map.jinja" import client with context %} +{%- if client.get('enabled', False) %} + +/etc/salt/minion.d/_elasticsearch.conf: + file.managed: + - source: salt://elasticsearch/files/_elasticsearch.conf + - template: jinja + - user: root + - group: root + +elasticsearch_client_packages: + pkg.installed: + - names: {{ client.pkgs }} + +{%- endif %} -- 2.32.7