From 8cc530dd4c1437d6f697f2da6c40c8582bc1b7ca Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 23 Oct 2024 09:36:17 -0400 Subject: [PATCH] fix HELD for debian families --- salt/versionlock/map.jinja | 7 ++++++- salt/versionlock/soc_versionlock.yaml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/salt/versionlock/map.jinja b/salt/versionlock/map.jinja index e078ff22d..1477657bc 100644 --- a/salt/versionlock/map.jinja +++ b/salt/versionlock/map.jinja @@ -5,7 +5,12 @@ {% import_yaml 'versionlock/defaults.yaml' as VERSIONLOCKDEFAULTS %} {% set VERSIONLOCKMERGED = salt['pillar.get']('versionlock', VERSIONLOCKDEFAULTS.versionlock, merge=True) %} -{% set HELD = salt['pkg.list_holds']() %} + +{% if grains.os_family == 'RedHat' %} +{% set HELD = salt['pkg.list_holds']() %} +{% else %} +{% set HELD = salt['pkg.get_selections'](state='hold')['hold'] %} +{% endif %} {# these are packages held / versionlock in other states #} {% set PACKAGES_HELD_IN_OTHER_STATES = [ diff --git a/salt/versionlock/soc_versionlock.yaml b/salt/versionlock/soc_versionlock.yaml index f1e864d7d..92fd69875 100644 --- a/salt/versionlock/soc_versionlock.yaml +++ b/salt/versionlock/soc_versionlock.yaml @@ -1,6 +1,6 @@ versionlock: hold: - description: List of packages to prevent from upgrading. To reduce the frequency of required reboots, add 'kernel' to this list. + description: List of packages to prevent from upgrading. To reduce the frequency of required reboots, add 'kernel' to this list for RedHat based OS families. For Debian, please see the documentation. global: True forcedType: "[]string" multiline: True