Move In Day

This commit is contained in:
Mike Reeves
2022-09-07 09:06:25 -04:00
parent dcb7b49dbe
commit 2bd9dd80e2
611 changed files with 8015 additions and 16211 deletions

View File

@@ -0,0 +1,14 @@
{% import 'vars/init.map.jinja' as INIT %}
{%
set ELASTICSEARCH_GLOBALS = {
'elasticsearch': {
'auth': INIT.PILLAR.elasticsearch.auth,
'es_cluster_name': INIT.PILLAR.elasticsearch.config.cluster.name,
'es_heap': INIT.PILLAR.elasticsearch.esheap
}
}
%}

View File

@@ -0,0 +1,50 @@
{% import 'vars/init.map.jinja' as INIT %}
{% from 'vars/' ~ INIT.GRAINS.role.split('-')[1] ~ '.map.jinja' import ROLE_GLOBALS %} {# role is so-role so we have to split off the 'so' #}
{%
set GLOBALS = {
'hostname': INIT.GRAINS.nodename,
'is_manager': false,
'manager': INIT.GRAINS.master,
'minion_id': INIT.GRAINS.id,
'node_ip': INIT.GRAINS.ip_interfaces.get(INIT.PILLAR.host.mainint)[0],
'role': INIT.GRAINS.role,
'airgap': INIT.PILLAR.global.airgap,
'ids': INIT.PILLAR.global.ids,
'image_repo': INIT.PILLAR.global.imagerepo,
'repo_host': INIT.PILLAR.global.repo_host,
'registry_host': INIT.PILLAR.global.registry_host,
'manager_ip': INIT.PILLAR.global.managerip,
'md_engine': INIT.PILLAR.global.mdengine,
'pipeline': INIT.PILLAR.global.pipeline,
'so_version': INIT.PILLAR.global.soversion,
'url_base': INIT.PILLAR.global.url_base,
'docker_range': INIT.PILLAR.docker.range,
'application_urls': {},
'manager_roles': [
'so-eval',
'so-import',
'so-manager',
'so-managersearch',
'so-standalone'
]
}
%}
{%
do GLOBALS.update({
'application_urls': {
'kratos': 'http://' ~ GLOBALS.manager_ip ~ ':4434/',
'elastic': 'https://' ~ GLOBALS.manager_ip ~ ':9200/',
'influxdb': 'https://' ~ GLOBALS.manager_ip ~ ':8086/'
}
})
%}
{% if GLOBALS.role in GLOBALS.manager_roles %}
{% do GLOBALS.update({'is_manager': true}) %}
{% endif %}
{% do salt['defaults.merge'](GLOBALS, ROLE_GLOBALS, merge_lists=False, in_place=True) %}

2
salt/vars/init.map.jinja Normal file
View File

@@ -0,0 +1,2 @@
{% set PILLAR = pillar %} {# store the in-memory pillar data #}
{% set GRAINS = grains %} {# store the in-memory grain data #}

View File

@@ -0,0 +1,11 @@
{% import 'vars/init.map.jinja' as INIT %}
{%
set LOGSTASH_GLOBALS = {
'logstash': {
'nodes': INIT.PILLAR.logstash.get('nodes', {})
}
}
%}

View File

@@ -0,0 +1,8 @@
{% set ROLE_GLOBALS = {} %}
{% set SENSOR_GLOBALS = []
%}
{% for sg in SENSOR_GLOBALS %}
{% do salt['defaults.merge'](ROLE_GLOBALS, sg, merge_lists=False, in_place=True) %}
{% endfor %}

View File

@@ -0,0 +1,15 @@
{% from 'vars/elasticsearch.map.jinja' import ELASTICSEARCH_GLOBALS %}
{% from 'vars/logstash.map.jinja' import LOGSTASH_GLOBALS %}
{% set ROLE_GLOBALS = {} %}
{% set STANDALONE_GLOBALS =
[
ELASTICSEARCH_GLOBALS,
LOGSTASH_GLOBALS
]
%}
{% for sg in STANDALONE_GLOBALS %}
{% do salt['defaults.merge'](ROLE_GLOBALS, sg, merge_lists=False, in_place=True) %}
{% endfor %}