From: Guillaume Thouvenin Date: Fri, 2 Dec 2016 09:32:57 +0000 (+0100) Subject: Separate the configuration and other part of the client X-Git-Tag: 2016.12~2^2 X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=commitdiff_plain;h=3ad837a7bf51351e2c0ba896fb68f32d7080f970 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. --- 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 %}