Reorder airgap prompt and add additional logic

Setup should now only ask the user whether to setup as airgap on manager-type installs. For all distributed minions setup will now inherit the airgap boolean from the manager.
This commit is contained in:
William Wernert
2021-10-27 11:03:00 -04:00
parent 331801eec2
commit 9e9079f9cb

View File

@@ -265,14 +265,6 @@ if [[ $is_manager || $is_import ]]; then
fi fi
if ! [[ -f $install_opt_file ]]; then if ! [[ -f $install_opt_file ]]; then
# Check if this is an airgap install
if [[ ( $is_manager || $is_import || $is_minion ) && $is_iso ]]; then
whiptail_airgap
if [[ "$INTERWEBS" == 'AIRGAP' ]]; then
is_airgap=true
fi
fi
if [[ $is_manager && $is_sensor ]]; then if [[ $is_manager && $is_sensor ]]; then
check_requirements "standalone" check_requirements "standalone"
elif [[ $is_fleet_standalone ]]; then elif [[ $is_fleet_standalone ]]; then
@@ -312,17 +304,6 @@ if ! [[ -f $install_opt_file ]]; then
add_mngr_ip_to_hosts add_mngr_ip_to_hosts
fi fi
reset_proxy
if [[ -z $is_airgap ]]; then
collect_net_method
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
fi
if [[ $is_minion ]]; then
whiptail_ssh_key_copy_notice
copy_ssh_key >> $setup_log 2>&1
fi
if [[ $is_minion ]] && ! (compare_versions); then if [[ $is_minion ]] && ! (compare_versions); then
info "Installer version mismatch, downloading correct version from manager" info "Installer version mismatch, downloading correct version from manager"
printf '%s\n' \ printf '%s\n' \
@@ -331,17 +312,36 @@ if ! [[ -f $install_opt_file ]]; then
"HOSTNAME=$HOSTNAME" \ "HOSTNAME=$HOSTNAME" \
"MSRV=$MSRV" \ "MSRV=$MSRV" \
"MSRVIP=$MSRVIP" \ "MSRVIP=$MSRVIP" \
"is_airgap=$is_airgap" \
"NODE_DESCRIPTION=\"$NODE_DESCRIPTION\"" > "$install_opt_file" "NODE_DESCRIPTION=\"$NODE_DESCRIPTION\"" > "$install_opt_file"
[[ -n $so_proxy ]] && echo "so_proxy=$so_proxy" >> "$install_opt_file"
download_repo_tarball download_repo_tarball
exec bash /root/manager_setup/securityonion/setup/so-setup "${original_args[@]}" exec bash /root/manager_setup/securityonion/setup/so-setup "${original_args[@]}"
fi fi
else else
rm -rf $install_opt_file >> "$setup_log" 2>&1 rm -rf $install_opt_file >> "$setup_log" 2>&1
fi fi
# Check if this is an airgap install
if [[ ( $is_manager || $is_import) && $is_iso ]]; then
whiptail_airgap
if [[ "$INTERWEBS" == 'AIRGAP' ]]; then
is_airgap=true
fi
el [[ $is_minion ]]
airgap_mngr_str=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}') >> $setup_log 2>&1
[[ $airgap_mngr_str == "True" ]] && is_airgap=true >> $setup_log 2>&1
fi
reset_proxy
if [[ -z $is_airgap ]]; then
collect_net_method
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
fi
if [[ $is_minion ]]; then
whiptail_ssh_key_copy_notice
copy_ssh_key >> $setup_log 2>&1
fi
percentage=0 percentage=0
{ {
installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs