From 276c011a4f8b6727567a7f05d3dc47f6744a3bf4 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 18 Nov 2020 13:22:11 -0500 Subject: [PATCH] queue state and change upgrade command https://github.com/Security-Onion-Solutions/securityonion/issues/1961 --- salt/common/tools/sbin/soup | 2 +- salt/salt/map.jinja | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index d8e3ee0bb..a256bb30d 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -521,7 +521,7 @@ if [ "$UPGRADESALT" == "1" ]; then if [ $is_airgap -eq 0 ]; then salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' cmd.run "yum clean all" fi - salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion + salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion queue=True echo "" fi diff --git a/salt/salt/map.jinja b/salt/salt/map.jinja index bb4a01fa9..1688e562a 100644 --- a/salt/salt/map.jinja +++ b/salt/salt/map.jinja @@ -12,12 +12,12 @@ {% if grains.saltversion|string != SALTVERSION|string %} {% if grains.os|lower in ['centos', 'redhat'] %} {% if ISAIRGAP is sameas true %} - {% set UPGRADECOMMAND = 'yum clean all && yum versionlock delete "salt-*" && /usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION ~ ' && yum versionlock add "salt-*" && salt-call state.highstate && pkill -9 -ef /usr/bin/salt-minion && systemctl restart salt-minion' %} + {% set UPGRADECOMMAND = 'yum clean all && yum versionlock delete "salt-*" && /usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION ~ ' && yum versionlock add "salt-*" && pkill -9 -ef /usr/bin/salt-minion && salt-call state.highstate && sleep 300 && salt-call state.apply salt.minion queue=True'%} {% else %} - {% set UPGRADECOMMAND = 'yum versionlock delete "salt-*" && /usr/sbin/bootstrap-salt.sh -s 120 -F -x python3 stable ' ~ SALTVERSION ~ ' && yum versionlock add "salt-*" && salt-call state.highstate && pkill -9 -ef /usr/bin/salt-minion && systemctl restart salt-minion' %} + {% set UPGRADECOMMAND = 'yum versionlock delete "salt-*" && /usr/sbin/bootstrap-salt.sh -s 120 -F -x python3 stable ' ~ SALTVERSION ~ ' && yum versionlock add "salt-*" && pkill -9 -ef /usr/bin/salt-minion && salt-call state.highstate && sleep 300 && salt-call state.apply salt.minion queue=True' %} {% endif %} {% elif grains.os|lower == 'ubuntu' %} - {% set UPGRADECOMMAND = 'apt-mark unhold salt-common && apt-mark unhold salt-minion && /usr/sbin/bootstrap-salt.sh -s 120 -F -x python3 stable ' ~ SALTVERSION ~ ' && apt-mark hold salt-common && apt-mark hold salt-minion && salt-call state.highstate && pkill -9 -ef /usr/bin/salt-minion && systemctl restart salt-minion' %} + {% set UPGRADECOMMAND = 'apt-mark unhold salt-common && apt-mark unhold salt-minion && /usr/sbin/bootstrap-salt.sh -s 120 -F -x python3 stable ' ~ SALTVERSION ~ ' && apt-mark hold salt-common && apt-mark hold salt-minion && pkill -9 -ef /usr/bin/salt-minion && salt-call state.highstate && sleep 300 && salt-call state.apply salt.minion queue=True' %} {% endif %} {% else %} {% set UPGRADECOMMAND = 'echo Already running Salt Minon version ' ~ SALTVERSION %}