mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-10 11:12:51 +01:00
prevent path.repo from being put in elasticsearch.yml if the symlink doesnt exist
This commit is contained in:
@@ -33,4 +33,15 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# merge with the elasticsearch pillar #}
|
||||
{% set ESCONFIG = salt['pillar.get']('elasticsearch:config', default=ESCONFIG.elasticsearch.config, merge=True) %}
|
||||
|
||||
{# remove elasticsearch.config.path.repo values if a symlink /nsm/elasticsearch/repo{{ repo }} doesn't exist #}
|
||||
{% if salt['pillar.get']('elasticsearch:config:path:repo', False) %}
|
||||
{% for repo in pillar.elasticsearch.config.path.repo %}
|
||||
{# retcode is 1 if symlink doesn't exist #}
|
||||
{% if salt['cmd.retcode']('test -L /nsm/elasticsearch/repo'~repo) %}
|
||||
{% do ESCONFIG.path.repo.remove(repo) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@@ -325,12 +325,9 @@ so-elasticsearch:
|
||||
- /opt/so/conf/elasticsearch/users_roles:/usr/share/elasticsearch/config/users_roles:ro
|
||||
- /opt/so/conf/elasticsearch/users:/usr/share/elasticsearch/config/users:ro
|
||||
{% endif %}
|
||||
{% if ES_PATH_REPO %}
|
||||
{% for repo in ES_PATH_REPO %}
|
||||
# /nsm/elasticsearch/repo{{ repo }} must exist as a symlink for the bind to be created
|
||||
{% if salt['cmd.retcode']('test ! -L /nsm/elasticsearch/repo'~repo) %}
|
||||
{% if ESCONFIG.path.repo %}
|
||||
{% for repo in ESCONFIG.path.repo %}
|
||||
- /nsm/elasticsearch/repo{{ repo }}:{{ repo }}:rw
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- watch:
|
||||
|
||||
Reference in New Issue
Block a user