only add elasticsearch.auth to elasticsearch global var if auth exists

This commit is contained in:
m0duspwnens
2022-10-13 12:31:41 -04:00
parent 78b496a689
commit 04b4030eb6

View File

@@ -1,14 +1,14 @@
{% import 'vars/init.map.jinja' as INIT %}
{%
set ELASTICSEARCH_GLOBALS = {
'elasticsearch': {
'auth': INIT.PILLAR.elasticsearch.auth,
'es_cluster_name': INIT.PILLAR.elasticsearch.config.cluster.name,
'es_heap': INIT.PILLAR.elasticsearch.esheap
}
}
%}
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
{% do ELASTICSEARCH_GLOBALS.elasticsearch.append({'auth': PILLAR.elasticsearch.auth}) %}
{% endif %}