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