From 91ef9b936611b0ee8bfc2db0023fd4fcb51b6f26 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 11 Jan 2022 10:57:48 -0500 Subject: [PATCH] update salt mine before salt-master and salt-minion get stopped --- salt/common/tools/sbin/soup | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index eb57ca441..5afc83cce 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -731,6 +731,13 @@ update_centos_repo() { createrepo /nsm/repo } +update_salt_mine() { + echo "Populating the mine with network.ip_addrs pillar.host.mainint for each host." + set +e + salt \* cmd.run cmd='MAININT=$(salt-call pillar.get host:mainint --out=newline_values_only) && salt-call mine.send name=network.ip_addrs interface="$MAININT"' + set -e +} + update_version() { # Update the version to the latest echo "Updating the Security Onion version file." @@ -969,6 +976,9 @@ main() { echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION." echo "" + # update mine items prior to stopping salt-minion and salt-master + update_salt_mine + echo "Updating dockers to $NEWVERSION." if [[ $is_airgap -eq 0 ]]; then airgap_update_dockers @@ -1056,11 +1066,6 @@ main() { salt-call state.apply salt.python3-influxdb -l info queue=True echo "" - echo "Populating the mine with network.ip_addrs pillar.host.mainint for each host." - set +e - salt \* cmd.run cmd='MAININT=$(salt-call pillar.get host:mainint --out=newline_values_only) && salt-call mine.send name=network.ip_addrs interface="$MAININT"' - set -e - # Only regenerate osquery packages if Fleet is enabled FLEET_MANAGER=$(lookup_pillar fleet_manager) FLEET_NODE=$(lookup_pillar fleet_node)