changes for script to auth to elastic

This commit is contained in:
m0duspwnens
2021-05-24 10:13:29 -04:00
parent de4fde4ee3
commit e2d5102a0e
17 changed files with 57 additions and 30 deletions
+19 -4
View File
@@ -1,8 +1,11 @@
{% from 'allowed_states.map.jinja' import allowed_states %}
{% if sls in allowed_states %}
{% set ELASTICUSER = salt['pillar.get']('elasticsearch:auth:user', '' ) %}
{% set ELASTICPASS = salt['pillar.get']('elasticsearch:auth:pass', '' ) %}
# This state is for checking things
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone'] %}
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone'] %}
# Make sure Cross Cluster is good. Will need some logic once we have hot/warm
crossclusterson:
cmd.script:
@@ -11,9 +14,15 @@ crossclusterson:
- runas: socore
- source: salt://utility/bin/crossthestreams
- template: jinja
- defaults:
ELASTICCURL: "curl"
{% if salt['pillar.get']('elasticsearch:auth_enabled', False) %}
- context:
ELASTICCURL: "curl --user {{ELASTICUSER}}:{{ELASTICPASS}}"
{% endif %}
{% endif %}
{% if grains['role'] in ['so-eval', 'so-import'] %}
{% endif %}
{% if grains['role'] in ['so-eval', 'so-import'] %}
fixsearch:
cmd.script:
- shell: /bin/bash
@@ -21,7 +30,13 @@ fixsearch:
- runas: socore
- source: salt://utility/bin/eval
- template: jinja
{% endif %}
- defaults:
ELASTICCURL: "curl"
{% if salt['pillar.get']('elasticsearch:auth_enabled', False) %}
- context:
ELASTICCURL: "curl --user {{ELASTICUSER}}:{{ELASTICPASS}}"
{% endif %}
{% endif %}
{% else %}