mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #6773 from Security-Onion-Solutions/issue/6765
Issue/6765
This commit is contained in:
@@ -330,13 +330,15 @@ so-elasticsearch-pipelines-file:
|
|||||||
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
||||||
|
|
||||||
so-elasticsearch-pipelines:
|
so-elasticsearch-pipelines:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines {{ grains.host }}
|
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines {{ grains.host }}
|
||||||
- onchanges:
|
- onchanges:
|
||||||
- file: esingestconf
|
- file: esingestconf
|
||||||
- file: esingestdynamicconf
|
- file: esingestdynamicconf
|
||||||
- file: esyml
|
- file: esyml
|
||||||
- file: so-elasticsearch-pipelines-file
|
- file: so-elasticsearch-pipelines-file
|
||||||
|
- require:
|
||||||
|
- docker_container: so-elasticsearch
|
||||||
|
|
||||||
{% if TEMPLATES %}
|
{% if TEMPLATES %}
|
||||||
so-elasticsearch-templates:
|
so-elasticsearch-templates:
|
||||||
@@ -344,6 +346,8 @@ so-elasticsearch-templates:
|
|||||||
- name: /usr/sbin/so-elasticsearch-templates-load
|
- name: /usr/sbin/so-elasticsearch-templates-load
|
||||||
- cwd: /opt/so
|
- cwd: /opt/so
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- require:
|
||||||
|
- docker_container: so-elasticsearch
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
so-elasticsearch-roles-load:
|
so-elasticsearch-roles-load:
|
||||||
@@ -351,6 +355,8 @@ so-elasticsearch-roles-load:
|
|||||||
- name: /usr/sbin/so-elasticsearch-roles-load
|
- name: /usr/sbin/so-elasticsearch-roles-load
|
||||||
- cwd: /opt/so
|
- cwd: /opt/so
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- require:
|
||||||
|
- docker_container: so-elasticsearch
|
||||||
|
|
||||||
{% endif %} {# if grains['role'] != 'so-helix' #}
|
{% endif %} {# if grains['role'] != 'so-helix' #}
|
||||||
|
|
||||||
|
|||||||
@@ -2042,6 +2042,9 @@ reserve_ports() {
|
|||||||
reinstall_init() {
|
reinstall_init() {
|
||||||
info "Putting system in state to run setup again"
|
info "Putting system in state to run setup again"
|
||||||
|
|
||||||
|
# remove all of root's cronjobs
|
||||||
|
crontab -r -u root
|
||||||
|
|
||||||
if [[ $install_type =~ ^(MANAGER|EVAL|HELIXSENSOR|MANAGERSEARCH|STANDALONE|FLEET|IMPORT)$ ]]; then
|
if [[ $install_type =~ ^(MANAGER|EVAL|HELIXSENSOR|MANAGERSEARCH|STANDALONE|FLEET|IMPORT)$ ]]; then
|
||||||
local salt_services=( "salt-master" "salt-minion" )
|
local salt_services=( "salt-master" "salt-minion" )
|
||||||
else
|
else
|
||||||
@@ -2081,7 +2084,7 @@ reinstall_init() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Remove all salt configs
|
# Remove all salt configs
|
||||||
rm -rf /etc/salt/grains /etc/salt/minion /etc/salt/pki/*
|
rm -rf /etc/salt/engines/* /etc/salt/grains /etc/salt/master /etc/salt/master.d/* /etc/salt/minion /etc/salt/minion.d/* /etc/salt/pki/* /etc/salt/proxy /etc/salt/proxy.d/* /var/cache/salt/
|
||||||
|
|
||||||
if command -v docker &> /dev/null; then
|
if command -v docker &> /dev/null; then
|
||||||
# Stop and remove all so-* containers so files can be changed with more safety
|
# Stop and remove all so-* containers so files can be changed with more safety
|
||||||
@@ -2096,6 +2099,12 @@ reinstall_init() {
|
|||||||
|
|
||||||
# Backup /opt/so since we'll be rebuilding this directory during setup
|
# Backup /opt/so since we'll be rebuilding this directory during setup
|
||||||
backup_dir /opt/so "$date_string"
|
backup_dir /opt/so "$date_string"
|
||||||
|
# We need to restore these files during a reinstall so python3-influxdb state doesn't try to patch again
|
||||||
|
restore_file "/opt/so_old_$date_string/state/influxdb_continuous_query.py.patched" "/opt/so/state/"
|
||||||
|
restore_file "/opt/so_old_$date_string/state/influxdb_retention_policy.py.patched" "/opt/so/state/"
|
||||||
|
restore_file "/opt/so_old_$date_string/state/influxdbmod.py.patched" "/opt/so/state/"
|
||||||
|
# If the elastic license has been accepted restore the state file
|
||||||
|
restore_file "/opt/so_old_$date_string/state/yeselastic.txt" "/opt/so/state/"
|
||||||
|
|
||||||
# Backup directories in /nsm to prevent app errors
|
# Backup directories in /nsm to prevent app errors
|
||||||
backup_dir /nsm/mysql "$date_string"
|
backup_dir /nsm/mysql "$date_string"
|
||||||
@@ -2129,6 +2138,16 @@ reset_proxy() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
restore_file() {
|
||||||
|
src=$1
|
||||||
|
dst=$2
|
||||||
|
if [ -f "$src" ]; then
|
||||||
|
[ ! -d "$dst" ] && mkdir -v -p "$dst"
|
||||||
|
echo "Restoring $src to $dst." >> "$setup_log" 2>&1
|
||||||
|
cp -v "$src" "$dst"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
backup_dir() {
|
backup_dir() {
|
||||||
dir=$1
|
dir=$1
|
||||||
backup_suffix=$2
|
backup_suffix=$2
|
||||||
|
|||||||
Reference in New Issue
Block a user