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 %}