mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
Merge pull request #12965 from Security-Onion-Solutions/orchit
searchnode installation improvements
This commit is contained in:
20
salt/elasticsearch/download.sls
Normal file
20
salt/elasticsearch/download.sls
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
|
so-elasticsearch_image:
|
||||||
|
docker_image.present:
|
||||||
|
- name: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elasticsearch:{{ GLOBALS.so_version }}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{{sls}}_state_not_allowed:
|
||||||
|
test.fail_without_changes:
|
||||||
|
- name: {{sls}}_state_not_allowed
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
20
salt/logstash/download.sls
Normal file
20
salt/logstash/download.sls
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
|
so-logstash_image:
|
||||||
|
docker_image.present:
|
||||||
|
- name: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-logstash:{{ GLOBALS.so_version }}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{{sls}}_state_not_allowed:
|
||||||
|
test.fail_without_changes:
|
||||||
|
- name: {{sls}}_state_not_allowed
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
@@ -604,6 +604,10 @@ function updateMineAndApplyStates() {
|
|||||||
#checkMine "network.ip_addrs"
|
#checkMine "network.ip_addrs"
|
||||||
# calls so-common and set_minionid sets MINIONID to local minion id
|
# calls so-common and set_minionid sets MINIONID to local minion id
|
||||||
set_minionid
|
set_minionid
|
||||||
|
# if this is a searchnode or heavynode, start downloading logstash and elasticsearch containers while the manager prepares for the new node
|
||||||
|
if [[ "$NODETYPE" == "SEARCHNODE" || "$NODETYPE" == "HEAVYNODE" ]]; then
|
||||||
|
salt-run state.orch orch.container_download pillar="{'setup': {'newnode': $MINION_ID }}" > /dev/null 2>&1 &
|
||||||
|
fi
|
||||||
# $MINIONID is the minion id of the manager and $MINION_ID is the target node or the node being configured
|
# $MINIONID is the minion id of the manager and $MINION_ID is the target node or the node being configured
|
||||||
salt-run state.orch orch.deploy_newnode pillar="{'setup': {'manager': $MINIONID, 'newnode': $MINION_ID }}" > /dev/null 2>&1 &
|
salt-run state.orch orch.deploy_newnode pillar="{'setup': {'manager': $MINIONID, 'newnode': $MINION_ID }}" > /dev/null 2>&1 &
|
||||||
}
|
}
|
||||||
|
|||||||
17
salt/orch/container_download.sls
Normal file
17
salt/orch/container_download.sls
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% set NEWNODE = salt['pillar.get']('setup:newnode') %}
|
||||||
|
|
||||||
|
{% if NEWNODE.split('_')|last in ['searchnode', 'heavynode'] %}
|
||||||
|
{{NEWNODE}}_download_logstash_elasticsearch:
|
||||||
|
salt.state:
|
||||||
|
- tgt: {{ NEWNODE }}
|
||||||
|
- sls:
|
||||||
|
- repo.client
|
||||||
|
- docker
|
||||||
|
- logstash.download
|
||||||
|
- elasticsearch.download
|
||||||
|
{% endif %}
|
||||||
@@ -144,13 +144,13 @@ base:
|
|||||||
|
|
||||||
'*_searchnode and G@saltversion:{{saltversion}}':
|
'*_searchnode and G@saltversion:{{saltversion}}':
|
||||||
- match: compound
|
- match: compound
|
||||||
|
- firewall
|
||||||
- ssl
|
- ssl
|
||||||
|
- elasticsearch
|
||||||
|
- logstash
|
||||||
- sensoroni
|
- sensoroni
|
||||||
- telegraf
|
- telegraf
|
||||||
- nginx
|
- nginx
|
||||||
- firewall
|
|
||||||
- elasticsearch
|
|
||||||
- logstash
|
|
||||||
- elasticfleet.install_agent_grid
|
- elasticfleet.install_agent_grid
|
||||||
- stig
|
- stig
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user