{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG %} {% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %} {% do ESCONFIG.elasticsearch.defaults.xpack.security.authc.anonymous.update({'username': 'anonymous_user', 'roles': 'superuser', 'authz_exception': 'true'}) %} {% endif %}