diff --git a/salt/versionlock/init.sls b/salt/versionlock/init.sls index 278809aee..a310356b4 100644 --- a/salt/versionlock/init.sls +++ b/salt/versionlock/init.sls @@ -3,16 +3,17 @@ # https://securityonion.net/license; you may not use this file except in compliance with the # Elastic License 2.0. -{% from 'versionlock/map.jinja' import VERSIONLOCKMERGED %} - -{% for pkg in VERSIONLOCKMERGED.hold %} +{% if grains.os_family == 'Debian' or (grains.os_family == 'RedHat' and salt['pkg.version']('python3-dnf-plugin-versionlock') != "") %} +{% from 'versionlock/map.jinja' import VERSIONLOCKMERGED %} +{% for pkg in VERSIONLOCKMERGED.hold %} {{pkg}}_held: pkg.held: - name: {{pkg}} -{% endfor %} +{% endfor %} -{% for pkg in VERSIONLOCKMERGED.UNHOLD %} +{% for pkg in VERSIONLOCKMERGED.UNHOLD %} {{pkg}}_unheld: pkg.unheld: - name: {{pkg}} -{% endfor %} +{% endfor %} +{% endif %}