diff --git a/salt/salt/map.jinja b/salt/salt/map.jinja index 5f687ef3f..cc388edb4 100644 --- a/salt/salt/map.jinja +++ b/salt/salt/map.jinja @@ -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 %} diff --git a/salt/salt/master.sls b/salt/salt/master.sls index 6e320e4a6..cf9f4718c 100644 --- a/salt/salt/master.sls +++ b/salt/salt/master.sls @@ -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 diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index d26365485..807b04a4e 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -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 %} @@ -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 }}-0:{{INSTALLEDSALTVERSION}}-0.* {% endfor %} -{% endif %} install_salt_minion: cmd.run: @@ -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 }}-0:{{SALTVERSION}}-0.* {% endfor %} -{% endif %} remove_error_log_level_logfile: file.line: