From 994eabae1b4fabc35208d152682225e5ea8e6609 Mon Sep 17 00:00:00 2001 From: Wes Date: Fri, 10 Feb 2023 18:57:19 +0000 Subject: [PATCH] Manage policy loading in Elasticsearch state --- salt/elasticsearch/init.sls | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/salt/elasticsearch/init.sls b/salt/elasticsearch/init.sls index 43e8d9f72..b9caa2e89 100644 --- a/salt/elasticsearch/init.sls +++ b/salt/elasticsearch/init.sls @@ -53,9 +53,19 @@ es_sync_scripts: - source: salt://elasticsearch/tools/sbin - exclude_pat: - so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state + - so-elasticsearch-ilm-policy-load - defaults: GLOBALS: {{ GLOBALS }} +so-elasticsearch-ilm-policy-load-script: + file.managed: + - name: /usr/sbin/so-elasticsearch-ilm-policy-load + - source: salt://elasticsearch/tools/sbin/so-elasticsearch-ilm-policy-load + - user: 930 + - group: 939 + - mode: 754 + - template: jinja + so-elasticsearch-pipelines-script: file.managed: - name: /usr/sbin/so-elasticsearch-pipelines @@ -362,6 +372,16 @@ so-es-cluster-settings: - docker_container: so-elasticsearch - file: es_sync_scripts +so-elasticsearch-ilm-policy-load: + cmd.run: + - name: /usr/sbin/so-elasticsearch-ilm-policy-load + - cwd: /opt/so + - require: + - docker_container: so-elasticsearch + - file: so-elasticsearch-ilm-policy-load-script + - onchanges: + - file: so-elasticsearch-ilm-policy-load-script + so-elasticsearch-templates: cmd.run: - name: /usr/sbin/so-elasticsearch-templates-load