diff --git a/salt/salt/map.jinja b/salt/salt/map.jinja index 1ff13f040..cb24cc85e 100644 --- a/salt/salt/map.jinja +++ b/salt/salt/map.jinja @@ -3,10 +3,10 @@ {% if grains.os == 'Ubuntu' %} {% set SPLITCHAR = '+' %} - {% set SALTNOTHELD = salt['cmd.run']('apt-mark showhold | grep salt-* ; echo $?', python_shell=True) %} + {% set SALTNOTHELD = salt['cmd.run']('apt-mark showhold | grep -q salt ; echo $?', python_shell=True) %} {% else %} {% set SPLITCHAR = '-' %} - {% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep salt-* ; echo $?', python_shell=True) %} + {% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep -q salt ; echo $?', python_shell=True) %} {% endif %} {% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %} diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index 5145da34b..633e1496d 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -11,7 +11,7 @@ include: {% if INSTALLEDSALTVERSION|string != SALTVERSION|string %} -{% if SALTNOTHELD == 0 %} +{% if SALTNOTHELD | int == 0 %} unhold_salt_packages: module.run: - pkg.unhold: @@ -29,7 +29,7 @@ install_salt_minion: {% if INSTALLEDSALTVERSION|string == SALTVERSION|string %} -{% if SALTNOTHELD == 1 %} +{% if SALTNOTHELD | int == 1 %} hold_salt_packages: module.run: - pkg.hold: