fix ubuntu salt-common package name

This commit is contained in:
m0duspwnens
2020-07-31 12:37:19 -04:00
parent 7287f5f935
commit d6f89cb09a
3 changed files with 26 additions and 14 deletions

View File

@@ -194,7 +194,7 @@ upgrade_check_salt() {
elif [ "$OS" == "ubuntu" ]; then
echo "Removing apt hold for Salt."
echo ""
apt-mark unhold "salt"
apt-mark unhold "salt-common"
apt-mark unhold "salt-master"
apt-mark unhold "salt-minion"
echo "Updating Salt packages and restarting services."
@@ -202,7 +202,7 @@ upgrade_check_salt() {
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
echo "Applying apt hold for Salt."
echo ""
apt-mark hold "salt"
apt-mark hold "salt-common"
apt-mark hold "salt-master"
apt-mark hold "salt-minion"
fi

21
salt/salt/map.jinja Normal file
View File

@@ -0,0 +1,21 @@
{% import_yaml 'salt/minion.defaults.yaml' as salt %}
{% set SALTVERSION = salt.salt.minion.version %}
{% set SALTPACKAGES = salt['grains.filter_by']({
'Ubuntu': {
'common': 'salt-common',
},
'Centos': {
'common': 'salt',
},
}) %}
{% if grains.saltversion|string != SALTVERSION|string %}
{% if grains.os|lower == 'centos' %}
{% set UPGRADECOMMAND = 'yum versionlock delete "salt-*" && sh bootstrap-salt.sh -F -x python3 stable ' ~ SALTVERSION %}
{% elif grains.os|lower == 'ubuntu' %}
{% set UPGRADECOMMAND = 'apt-mark unhold salt && apt-mark unhold salt-minion && sh bootstrap-salt.sh -F -x python3 stable ' ~ SALTVERSION %}
{% endif %}
{% else %}
{% set UPGRADECOMMAND = 'echo Already running Salt Minon version ' ~ SALTVERSION %}
{% endif %}

View File

@@ -1,18 +1,9 @@
include:
- salt
{% import_yaml 'salt/minion.defaults.yaml' as salt %}
{% set SALTVERSION = salt.salt.minion.version %}
{% from 'salt/map.jinja' import SALTPACKAGES with context %}
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
{% if grains.saltversion|string != SALTVERSION|string %}
{% if grains.os|lower == 'centos' %}
{% set UPGRADECOMMAND = 'yum versionlock delete "salt-*" && sh bootstrap-salt.sh -F -x python3 stable ' ~ SALTVERSION %}
{% elif grains.os|lower == 'ubuntu' %}
{% set UPGRADECOMMAND = 'apt-mark unhold salt && apt-mark unhold salt-minion && sh bootstrap-salt.sh -F -x python3 stable ' ~ SALTVERSION %}
{% endif %}
{% else %}
{% set UPGRADECOMMAND = 'echo Already running Salt Minon version ' ~ SALTVERSION %}
{% endif %}
install_salt_minion:
cmd.run:
@@ -26,7 +17,7 @@ install_salt_minion:
salt_minion_package:
pkg.installed:
- pkgs:
- salt
- {{ SALTPACKAGES.common }}
- salt-minion
- hold: True