move some es script to src elasticsearch/tools/sbin and dst /usr/sbin. set requires

This commit is contained in:
m0duspwnens
2022-01-12 10:20:05 -05:00
parent abf3a9401b
commit 494737549d
5 changed files with 36 additions and 16 deletions

View File

@@ -53,7 +53,7 @@ vm.max_map_count:
cascriptsync:
file.managed:
- name: /usr/sbin/so-catrust
- source: salt://elasticsearch/files/scripts/so-catrust
- source: salt://elasticsearch/tools/sbin/so-catrust
- user: 939
- group: 939
- mode: 750
@@ -63,9 +63,37 @@ cascriptsync:
cascriptfun:
cmd.run:
- name: /usr/sbin/so-catrust
- require:
- file: cascriptsync
{% endif %}
# Sync some es scripts
es_sync_scripts:
file.recurse:
- name: /usr/sbin
- user: root
- group: root
- file_mode: 755
- template: jinja
- source: salt://elasticsearch/tools/sbin
- defaults:
ELASTICCURL: 'curl'
- context:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
- exclude_pat:
- so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state
so-elasticsearch-pipelines-script:
file.managed:
- name: /usr/sbin/so-elasticsearch-pipelines
- source: salt://elasticsearch/tools/sbin/so-elasticsearch-pipelines
- user: 930
- group: 939
- mode: 754
- template: jinja
- defaults:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
# Move our new CA over so Elastic and Logstash can use SSL with the internal CA
catrustdir:
file.directory:
@@ -297,7 +325,7 @@ so-elasticsearch:
- file: esyml
- file: esingestconf
- file: esingestdynamicconf
- file: so-elasticsearch-pipelines-file
- file: so-elasticsearch-pipelines-script
- require:
- file: esyml
- file: eslog4jfile
@@ -322,27 +350,17 @@ append_so-elasticsearch_so-status.conf:
- name: /opt/so/conf/so-status/so-status.conf
- text: so-elasticsearch
so-elasticsearch-pipelines-file:
file.managed:
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines
- source: salt://elasticsearch/files/so-elasticsearch-pipelines
- user: 930
- group: 939
- mode: 754
- template: jinja
- defaults:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
so-elasticsearch-pipelines:
cmd.run:
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines {{ grains.host }}
- name: /usr/sbin/so-elasticsearch-pipelines {{ grains.host }}
- onchanges:
- file: esingestconf
- file: esingestdynamicconf
- file: esyml
- file: so-elasticsearch-pipelines-file
- file: so-elasticsearch-pipelines-script
- require:
- docker_container: so-elasticsearch
- file: so-elasticsearch-pipelines-script
{% if TEMPLATES %}
so-elasticsearch-templates:
@@ -352,6 +370,7 @@ so-elasticsearch-templates:
- template: jinja
- require:
- docker_container: so-elasticsearch
- file: es_sync_scripts
{% endif %}
so-elasticsearch-roles-load:
@@ -361,6 +380,7 @@ so-elasticsearch-roles-load:
- template: jinja
- require:
- docker_container: so-elasticsearch
- file: es_sync_scripts
{% endif %} {# if grains['role'] != 'so-helix' #}