Skip to content

Commit

Permalink
Merge pull request #13441 from Security-Onion-Solutions/issue/13438
Browse files Browse the repository at this point in the history
Issue/13438
  • Loading branch information
m0duspwnens authored Aug 6, 2024
2 parents 56ef2a4 + 009c8d5 commit 3713ee9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
8 changes: 6 additions & 2 deletions salt/manager/tools/sbin/soup
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,9 @@ upgrade_salt() {
if [[ $is_rpm ]]; then
echo "Removing yum versionlock for Salt."
echo ""
yum versionlock delete "salt-*"
yum versionlock delete "salt"
yum versionlock delete "salt-minion"
yum versionlock delete "salt-master"
echo "Updating Salt packages."
echo ""
set +e
Expand All @@ -975,7 +977,9 @@ upgrade_salt() {
set -e
echo "Applying yum versionlock for Salt."
echo ""
yum versionlock add "salt-*"
yum versionlock add "salt-0:$NEWSALTVERSION-0.*"
yum versionlock add "salt-minion-0:$NEWSALTVERSION-0.*"
yum versionlock add "salt-master-0:$NEWSALTVERSION-0.*"
# Else do Ubuntu things
elif [[ $is_deb ]]; then
echo "Removing apt hold for Salt."
Expand Down
2 changes: 0 additions & 2 deletions salt/salt/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

{% if grains.os_family == 'Debian' %}
{% set SPLITCHAR = '+' %}
{% set SALTNOTHELD = salt['cmd.run']('apt-mark showhold | grep -q salt ; echo $?', python_shell=True) %}
{% set SALTPACKAGES = ['salt-common', 'salt-master', 'salt-minion'] %}
{% set SYSTEMD_UNIT_FILE = '/lib/systemd/system/salt-minion.service' %}
{% else %}
{% set SPLITCHAR = '-' %}
{% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep -q salt ; echo $?', python_shell=True) %}
{% set SALTPACKAGES = ['salt', 'salt-master', 'salt-minion'] %}
{% set SYSTEMD_UNIT_FILE = '/usr/lib/systemd/system/salt-minion.service' %}
{% endif %}
Expand Down
3 changes: 0 additions & 3 deletions salt/salt/master.sls
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{% from 'salt/map.jinja' import SALTNOTHELD %}
{% from 'allowed_states.map.jinja' import allowed_states %}
{% if sls in allowed_states %}
include:
- salt.minion
{% if SALTNOTHELD == 1 %}
hold_salt_master_package:
module.run:
- pkg.hold:
- name: salt-master
{% endif %}
# prior to 2.4.30 this engine ran on the manager with salt-minion
# this has changed to running with the salt-master in 2.4.30
Expand Down
19 changes: 6 additions & 13 deletions salt/salt/minion.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
{% from 'salt/map.jinja' import SALTVERSION %}
{% from 'salt/map.jinja' import INSTALLEDSALTVERSION %}
{% from 'salt/map.jinja' import SALTNOTHELD %}
{% from 'salt/map.jinja' import SALTPACKAGES %}
{% from 'salt/map.jinja' import SYSTEMD_UNIT_FILE %}
{% import_yaml 'salt/minion.defaults.yaml' as SALTMINION %}
Expand All @@ -20,15 +19,12 @@ include:
{% if INSTALLEDSALTVERSION|string != SALTVERSION|string %}
{% if SALTNOTHELD | int == 0 %}
unhold_salt_packages:
module.run:
- pkg.unhold:
- pkgs:
pkg.unheld:
- pkgs:
{% for package in SALTPACKAGES %}
- {{ package }}
- {{ package }}
{% endfor %}
{% endif %}
install_salt_minion:
cmd.run:
Expand All @@ -42,15 +38,12 @@ install_salt_minion:
{% if INSTALLEDSALTVERSION|string == SALTVERSION|string %}
{% if SALTNOTHELD | int == 1 %}
hold_salt_packages:
module.run:
- pkg.hold:
- pkgs:
pkg.held:
- pkgs:
{% for package in SALTPACKAGES %}
- {{ package }}
- {{ package }}: {{SALTVERSION}}-0.*
{% endfor %}
{% endif %}
remove_error_log_level_logfile:
file.line:
Expand Down

0 comments on commit 3713ee9

Please sign in to comment.