mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
[fix] Don't set startup state until end of setup
This commit is contained in:
@@ -339,13 +339,20 @@ configure_minion() {
|
||||
" - module.run"\
|
||||
"log_file: /opt/so/log/salt/minion" >> "$minion_config"
|
||||
|
||||
systemctl restart salt-minion >> "$setup_log" 2>&1
|
||||
{
|
||||
systemctl restart salt-minion;
|
||||
printf '%s\n' '----';
|
||||
cat "$minion_config";
|
||||
} >> "$setup_log" 2>&1
|
||||
|
||||
|
||||
}
|
||||
|
||||
checkin_at_boot() {
|
||||
local minion_config=/etc/salt/minion
|
||||
|
||||
echo "Enabling checkin at boot" >> "$setup_log" 2>&1
|
||||
echo "startup_states: highstate" >> "$minion_config"
|
||||
|
||||
printf '%s\n' '----' >> "$setup_log" 2>&1
|
||||
cat "$minion_config" >> "$setup_log" 2>&1
|
||||
}
|
||||
|
||||
copy_master_config() {
|
||||
@@ -534,7 +541,6 @@ docker_install() {
|
||||
{
|
||||
yum clean expire-cache;
|
||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo;
|
||||
yum -y update;
|
||||
yum -y install docker-ce;
|
||||
} >> "$setup_log" 2>&1
|
||||
|
||||
@@ -684,12 +690,6 @@ set_main_ip() {
|
||||
MAINIP=$(ip route get 1 | awk '{print $7;exit}')
|
||||
}
|
||||
|
||||
gen_ca() {
|
||||
salt_checkin
|
||||
salt-call state.apply -l info ca >> $setup_log 2>&1
|
||||
salt-call state.apply -l info ssl >> $setup_log 2>&1
|
||||
}
|
||||
|
||||
get_redirect() {
|
||||
whiptail_set_redirect_info
|
||||
whiptail_set_redirect
|
||||
@@ -830,6 +830,9 @@ master_static() {
|
||||
" masterupdate: $MASTERUPDATES" > "$static_pillar"
|
||||
echo "elastic:" >> /opt/so/saltstack/pillar/static.sls
|
||||
echo " features: False" >> /opt/so/saltstack/pillar/static.sls
|
||||
|
||||
printf '%s\n' '----' >> "$setup_log" 2>&1
|
||||
cat "$static_pillar" >> "$setup_log" 2>&1
|
||||
}
|
||||
|
||||
minio_generate_keys() {
|
||||
@@ -1112,8 +1115,11 @@ salt_checkin() {
|
||||
} >> "$setup_log" 2>&1
|
||||
;;
|
||||
*)
|
||||
salt-call state.apply ca >> "$setup_log" 2>&1
|
||||
salt-call state.apply ssl >> "$setup_log" 2>&1
|
||||
{
|
||||
salt-call state.apply ca;
|
||||
salt-call state.apply ssl;
|
||||
} >> "$setup_log" 2>&1
|
||||
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -1364,6 +1370,15 @@ update_sudoers() {
|
||||
fi
|
||||
}
|
||||
|
||||
update_packages() {
|
||||
if [ "$OS" = 'centos' ]; then
|
||||
yum -y update >> "$setup_log"
|
||||
else
|
||||
apt-get -y update >> "$setup_log"
|
||||
apt-get -y upgrade >> "$setup_log"
|
||||
fi
|
||||
}
|
||||
|
||||
ls_heapsize() {
|
||||
|
||||
if [ "$total_mem" -ge 32000 ]; then
|
||||
|
||||
@@ -257,6 +257,9 @@ if [[ $is_minion ]]; then
|
||||
fi
|
||||
|
||||
# Begin install
|
||||
|
||||
# Set initial percentage to 0
|
||||
export percentage=0
|
||||
{
|
||||
|
||||
if [[ $is_sensor || $is_helix ]]; then
|
||||
@@ -321,8 +324,8 @@ fi
|
||||
node_pillar 2>> "$setup_log"
|
||||
fi
|
||||
|
||||
set_progress_str 20 'Generating CA'
|
||||
gen_ca 2>> "$setup_log"
|
||||
set_progress_str 20 'Generating CA and checking in'
|
||||
salt_checkin 2>> "$setup_log"
|
||||
|
||||
if [[ $is_master || $is_helix ]]; then
|
||||
set_progress_str 25 'Downloading containers from the internet'
|
||||
@@ -428,7 +431,13 @@ fi
|
||||
filter_unused_nics 2>> "$setup_log"
|
||||
network_setup 2>> "$setup_log"
|
||||
|
||||
set_progress_str 91 'Verifying setup'
|
||||
set_progress_str 91 'Enabling checkin at boot'
|
||||
checkin_at_boot 2>> "$setup_log"
|
||||
|
||||
set_progress_str 92 'Updating packages'
|
||||
update_packages 2>> "$setup_log"
|
||||
|
||||
set_progress_str 93 'Verifying setup'
|
||||
salt-call -l info state.highstate >> $setup_log 2>&1
|
||||
|
||||
} | whiptail --title "Hybrid Hunter Install" --gauge "Please wait while installing" 6 60 0
|
||||
|
||||
@@ -28,8 +28,6 @@ export filesystem_nsm
|
||||
mkdir -p /root/installtmp/pillar/minions
|
||||
export temp_install_dir=/root/installtmp
|
||||
|
||||
export percentage=0
|
||||
|
||||
export percentage_str='Getting started'
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
Reference in New Issue
Block a user