generate pillar file if auth enabled or not

This commit is contained in:
m0duspwnens
2021-06-01 09:38:07 -04:00
parent 1aa2852ed6
commit f87dce8ec1

View File

@@ -31,9 +31,7 @@ elastic_auth_pillar:
# a highstate runs, we only manage the file each user isn't present in the file. if the # a highstate runs, we only manage the file each user isn't present in the file. if the
# pillar file doesn't exists, then the default vault provided to pillar.get should not # pillar file doesn't exists, then the default vault provided to pillar.get should not
# be within the file either, so it should then be created # be within the file either, so it should then be created
{% if salt['pillar.get']('elasticsearch:auth', False) %}
- unless: - unless:
{% for so_app_user, values in salt['pillar.get']('elasticsearch:auth:users', {'so_noapp_user': {'user': 'r@NDumu53Rd0NtDOoP'}}).items() %} {% for so_app_user, values in salt['pillar.get']('elasticsearch:auth:users', {'so_noapp_user': {'user': 'r@NDumu53Rd0NtDOoP'}}).items() %}
- grep {{ values.user }} /opt/so/saltstack/local/pillar/elasticsearch/auth.sls - grep {{ values.user }} /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
{% endfor%} {% endfor%}
{% endif %}