{%- if grains['role'] in ['so-managersearch', 'so-heavynode', 'so-node'] %} {%- set MANAGER = salt['grains.get']('host' '') %} {%- else %} {%- set MANAGER = salt['grains.get']('master') %} {%- endif %} {%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %} {%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %} output.elasticsearch: enabled: true hosts: ["https://{{ MANAGER }}:9200"] {% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %} username: "{{ ES_USER }}" password: "{{ ES_PASS }}" {% endif %} ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]