Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minion] [returner] [Elasticsearch] Yaml read patch + example.pillar update #359

Merged
merged 2 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,24 @@ salt:
- 'minion/deploy':
- /srv/salt/reactors/deploy.sls

# Optional: Configure an elasticsearch returner
return: elasticsearch
elasticsearch:
hosts:
- example.elasticsearch.host:9200
- example.elasticsearch.host2:9200
index_date: True
index: salt
number_of_shards: 5
number_of_replicas: 2
debug_returner_payload: True
states_count: True
states_order_output: True
states_single_index: True
functions_blacklist:
- test.ping
- saltutil.find_job

# salt cloud config
cloud:
master: salt
Expand Down Expand Up @@ -332,3 +350,4 @@ salt_formulas:
- salt-formula
- postfix-formula
- openssh-formula

8 changes: 5 additions & 3 deletions salt/files/minion.d/f_defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1215,16 +1215,18 @@ return:
{% if 'elasticsearch' in cfg_minion -%}
{%- do default_keys.append('elasticsearch') %}
{%- do default_keys.append('return') %}

##### elasticsearch connection settings #####
##########################################
elasticsearch:
{%- for name, value in cfg_minion['elasticsearch'].items() %}
{%- if value is list %}
elasticsearch.{{ name }}:
{{ name }}:
{%- for objvalue in value %}
- {{ objvalue }}
- {{ objvalue }}
{%- endfor %}
{%- else %}
elasticsearch.{{ name }}: {{ value }}
{{ name }}: {{ value }}
{%- endif %}
{%- endfor %}
{%- endif %}
Expand Down