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.
{%- 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 }}:
--- /dev/null
+{%- 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 %}