Merge pull request #6978 from Security-Onion-Solutions/es_binds

allow for path.repo mounts for elasticsearch
This commit is contained in:
Josh Patterson
2022-01-25 16:13:49 -05:00
committed by GitHub
2 changed files with 23 additions and 3 deletions

View File

@@ -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 %}

View File

@@ -24,7 +24,6 @@ include:
{% set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
{% set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
{% set MANAGERIP = salt['pillar.get']('global:managerip') %}
{% set ESMOUNT = salt['pillar.get']('elasticsearch:extramount', False) %}
{% if grains['role'] in ['so-eval','so-managersearch', 'so-manager', 'so-standalone', 'so-import'] %}
{% set esclustername = salt['pillar.get']('manager:esclustername') %}
@@ -235,6 +234,14 @@ eslogdir:
- group: 939
- makedirs: True
es_repo_dir:
file.directory:
- name: /nsm/elasticsearch/repo/
- user: 930
- group: 930
- require:
- file: nsmesdir
auth_users:
file.managed:
- name: /opt/so/conf/elasticsearch/users.tmp
@@ -317,8 +324,10 @@ 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 ESMOUNT %}
- {{ ESMOUNT }}:/snapshots:rw
{% if ESCONFIG.path.get('repo', False) %}
{% for repo in ESCONFIG.path.repo %}
- /nsm/elasticsearch/repo{{ repo }}:{{ repo }}:rw
{% endfor %}
{% endif %}
- watch:
- file: cacertz