[feat] Compare setup version to manager, dl tarball + exec on mismatch

This commit is contained in:
William Wernert
2020-12-08 15:29:04 -05:00
parent 4899ea23f8
commit b41ba1ea3c
2 changed files with 97 additions and 55 deletions

View File

@@ -518,6 +518,14 @@ check_requirements() {
fi
}
compare_versions() {
manager_ver=$(ssh -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion)
export manager_ver
[[ "$manager_ver" == "$SOVERSION" ]]
return
}
configure_network_sensor() {
echo "Setting up sensor interface" >> "$setup_log" 2>&1
local nic_error=0
@@ -913,6 +921,18 @@ docker_seed_registry() {
}
download_repo_tarball() {
scp -i /root/.ssh/so.key soremote@"$MSRV":/opt/so/repo/"$manager_ver".tar.gz /root/new_setup
# Fail if the file doesn't download
if ! [ -f /root/new_setup/"$manager_ver".tar.gz ]; then
kill -SIGUSR1 "$(ps --pid $$ -oppid=)"; exit 1
fi
tar -xzf /root/new_setup/"$manager_ver".tar.gz -C /root/new_setup/securityonion
rm -rf /root/new_setup/"$manager_ver".tar.gz
}
fireeye_pillar() {
local fireeye_pillar_path=$local_salt_dir/pillar/fireeye