Salt module elasticsearch depends on elasticsearch-py
This patch installs the python client.
diff --git a/elasticsearch/client.sls b/elasticsearch/client.sls
index f336cd3..4c8246e 100644
--- a/elasticsearch/client.sls
+++ b/elasticsearch/client.sls
@@ -8,6 +8,10 @@
- user: root
- group: root
+elasticsearch_client_packages:
+ pkg.installed:
+ - names: {{ client.pkgs }}
+
{%- for index_name, index in client.get('index', {}).iteritems() %}
elasticsearch_index_{{ index_name }}:
{%- if index.get('enabled', False) %}
@@ -19,6 +23,8 @@
elasticsearch_index_template.absent:
- name: {{ index_name }}
{%- endif %}
+ - require:
+ - pkg: elasticsearch_client_packages
{%- endfor %}
{%- endif %}
diff --git a/elasticsearch/map.jinja b/elasticsearch/map.jinja
index e2d7871..36dd674 100644
--- a/elasticsearch/map.jinja
+++ b/elasticsearch/map.jinja
@@ -20,7 +20,15 @@
{%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('elasticsearch:server')) %}
{%- load_yaml as client_defaults %}
-default:
+Debian:
+ pkgs:
+ - python-elasticsearch
+ server:
+ host: 127.0.0.1
+ port: 9200
+RedHat:
+ pkgs:
+ - python-elasticsearch
server:
host: 127.0.0.1
port: 9200