From c80adc04304d8d94e9a6ee349f145a6945c69ddc Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 26 Jan 2022 13:42:56 -0500 Subject: [PATCH] mount repo dir in container same as defined on host --- salt/elasticsearch/config.map.jinja | 5 ++--- salt/elasticsearch/init.sls | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/salt/elasticsearch/config.map.jinja b/salt/elasticsearch/config.map.jinja index c44e39e0d..b9ddaa988 100644 --- a/salt/elasticsearch/config.map.jinja +++ b/salt/elasticsearch/config.map.jinja @@ -36,11 +36,10 @@ {# 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) %} + {# remove elasticsearch.config.path.repo value if the directory doesn't exist on the node #} + {% if not salt['file.directory_exists'](repo) %} {% do ESCONFIG.path.repo.remove(repo) %} {% endif %} {% endfor %} diff --git a/salt/elasticsearch/init.sls b/salt/elasticsearch/init.sls index 8060757ed..ece110c8b 100644 --- a/salt/elasticsearch/init.sls +++ b/salt/elasticsearch/init.sls @@ -326,7 +326,7 @@ so-elasticsearch: {% endif %} {% if ESCONFIG.path.get('repo', False) %} {% for repo in ESCONFIG.path.repo %} - - /nsm/elasticsearch/repo{{ repo }}:{{ repo }}:rw + - {{ repo }}:{{ repo }}:rw {% endfor %} {% endif %} - watch: