mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
[refactor][fix] Update reinstall logic
* Only set reinstall flag if new accept_changes file exists * Instead of stopping highstate from running, kill all salt processes and remove their configs * Make end of non-reinstall logs clear in cases where user cancels (and log not rotated)
This commit is contained in:
@@ -1382,20 +1382,13 @@ reinstall_init() {
|
||||
info "Putting system in state to run setup again"
|
||||
|
||||
{
|
||||
local minion_config=/etc/salt/minion
|
||||
rm -f "$change_file"
|
||||
|
||||
# Remove startup_states from minion config so we don't immediately highstate when salt starts back up
|
||||
if [[ -f $minion_config ]] && grep -q "startup_states" $minion_config; then
|
||||
sed -i '/startup_states/d' $minion_config
|
||||
fi
|
||||
# Kill any salt processes
|
||||
pkill -9 -ef /usr/bin/salt
|
||||
|
||||
if command -v salt-call &> /dev/null; then
|
||||
# Disable schedule so highstate doesn't start running during the install
|
||||
salt-call -l info schedule.disable
|
||||
|
||||
# Kill any currently running salt jobs, also to prevent issues with highstate.
|
||||
salt-call -l info saltutil.kill_all_jobs
|
||||
fi
|
||||
# Remove all salt configs
|
||||
rm -rf /etc/salt/global /etc/salt/minion /etc/salt/master /etc/salt/pki/*
|
||||
|
||||
if command -v docker &> /dev/null; then
|
||||
# Stop and remove all so-* containers so files can be changed with more safety
|
||||
|
||||
Reference in New Issue
Block a user