Browse Source

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

* Minion/returner/elasticsearch yaml read fix.

* Improved the documentation for the elasticsearch returner
master
Felix Russell 6 years ago
parent
commit
9f33d2afe1
2 changed files with 24 additions and 3 deletions
  1. +19
    -0
      pillar.example
  2. +5
    -3
      salt/files/minion.d/f_defaults.conf

+ 19
- 0
pillar.example View File

- 'minion/deploy': - 'minion/deploy':
- /srv/salt/reactors/deploy.sls - /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 # salt cloud config
cloud: cloud:
master: salt master: salt
- salt-formula - salt-formula
- postfix-formula - postfix-formula
- openssh-formula - openssh-formula


+ 5
- 3
salt/files/minion.d/f_defaults.conf View File

{% if 'elasticsearch' in cfg_minion -%} {% if 'elasticsearch' in cfg_minion -%}
{%- do default_keys.append('elasticsearch') %} {%- do default_keys.append('elasticsearch') %}
{%- do default_keys.append('return') %} {%- do default_keys.append('return') %}

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

Loading…
Cancel
Save