starting es pillarization

This commit is contained in:
m0duspwnens
2021-08-25 10:23:06 -04:00
parent ef650c6ee6
commit 0681d29bb0
3 changed files with 1128 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG %}
{% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %}
{% do ESCONFIG.elasticsearch.defaults.xpack.security.authc.anonymous.update({'username': 'anonymous_user', 'roles': 'superuser', 'authz_exception': 'true'}) %}
{% endif %}

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,8 @@
{% from 'allowed_states.map.jinja' import allowed_states %} {% from 'allowed_states.map.jinja' import allowed_states %}
{% if sls in allowed_states %} {% if sls in allowed_states %}
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %} {% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} {% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% set MANAGER = salt['grains.get']('master') %} {% set MANAGER = salt['grains.get']('master') %}
@@ -36,6 +38,7 @@
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %} {% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %} {% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
{% from 'elasticsearch/config.map.jinja' import ESCONFIG with context %}
vm.max_map_count: vm.max_map_count:
@@ -142,6 +145,14 @@ esyml:
- group: 939 - group: 939
- template: jinja - template: jinja
esyml_test:
file.managed:
- name: /tmp/elasticsearch.yml
- source: salt://elasticsearch/files/elasticsearch.yml
- user: 930
- group: 939
- contents: {{ ESCONFIG | yaml }}
#sync templates to /opt/so/conf/elasticsearch/templates #sync templates to /opt/so/conf/elasticsearch/templates
{% for TEMPLATE in TEMPLATES %} {% for TEMPLATE in TEMPLATES %}
es_template_{{TEMPLATE.split('.')[0] | replace("/","_") }}: es_template_{{TEMPLATE.split('.')[0] | replace("/","_") }}: