Sync from SUSE:SLFO:Main ansible-core revision 65dcdd8388eb7d28c221bd51e102acaf
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 22 13:59:15 UTC 2025 - Harshvardhan Sharma <harshvardhan.sharma@suse.com>
|
||||
|
||||
- Add patch suse-distribution-fix.patch to fix distribution.py
|
||||
to identify the correct distribution for server-sap and micro
|
||||
(#PED-12643)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 7 08:09:45 UTC 2025 - Harshvardhan Sharma <harshvardhan.sharma@suse.com>
|
||||
|
||||
|
@@ -56,6 +56,8 @@ Patch1: https://github.com/ansible/ansible/commit/771f7ad29ca4d259761eaa
|
||||
# Upstream commit: d500354798beb9bf8341eb8e84e1e2046bbfd21b
|
||||
# Reference: https://github.com/ansible/ansible/commit/d500354798beb9bf8341eb8e84e1e2046bbfd21b
|
||||
Patch2: unarchive-test-fix.patch
|
||||
# Patch to fix distribution.py to identify the correct distribution for server-sap and micro
|
||||
Patch3: suse-distribution-fix.patch
|
||||
BuildArch: noarch
|
||||
|
||||
# cannot be installed with ansible < 3 or ansible-base
|
||||
|
42
suse-distribution-fix.patch
Normal file
42
suse-distribution-fix.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From b1edc4d3fd9136f81abd01c4b44f356a69e0b746 Mon Sep 17 00:00:00 2001
|
||||
From: HVSharma12 <harshvardhan.sharma@suse.com>
|
||||
Date: Tue, 22 Apr 2025 19:21:35 +0530
|
||||
Subject: [PATCH] Adjust distribution detection logic for SUSE
|
||||
|
||||
---
|
||||
.../module_utils/facts/system/distribution.py | 19 ++++++++++++++++---
|
||||
1 file changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py
|
||||
index 7554ef1ae3..77c39182b1 100644
|
||||
--- a/lib/ansible/module_utils/facts/system/distribution.py
|
||||
+++ b/lib/ansible/module_utils/facts/system/distribution.py
|
||||
@@ -311,9 +311,22 @@ class DistributionFiles:
|
||||
suse_facts['distribution_release'] = release.group(1)
|
||||
suse_facts['distribution_version'] = collected_facts['distribution_version'] + '.' + release.group(1)
|
||||
|
||||
- # See https://www.suse.com/support/kb/doc/?id=000019341 for SLES for SAP
|
||||
- if os.path.islink('/etc/products.d/baseproduct') and os.path.realpath('/etc/products.d/baseproduct').endswith('SLES_SAP.prod'):
|
||||
- suse_facts['distribution'] = 'SLES_SAP'
|
||||
+ # Check VARIANT_ID first for SLES4SAP or SL-Micro
|
||||
+ variant_id_match = re.search(r'^VARIANT_ID="?([^"\n]*)"?', data, re.MULTILINE)
|
||||
+ if variant_id_match:
|
||||
+ variant_id = variant_id_match.group(1)
|
||||
+ if variant_id == 'server-sap':
|
||||
+ suse_facts['distribution'] = 'SLES_SAP'
|
||||
+ elif variant_id == 'transactional':
|
||||
+ suse_facts['distribution'] = 'SL-Micro'
|
||||
+ else:
|
||||
+ # Fallback for older SLES 15 using baseproduct symlink
|
||||
+ if os.path.islink('/etc/products.d/baseproduct'):
|
||||
+ resolved = os.path.realpath('/etc/products.d/baseproduct')
|
||||
+ if resolved.endswith('SLES_SAP.prod'):
|
||||
+ suse_facts['distribution'] = 'SLES_SAP'
|
||||
+ elif resolved.endswith('SL-Micro.prod'):
|
||||
+ suse_facts['distribution'] = 'SL-Micro'
|
||||
|
||||
return True, suse_facts
|
||||
|
||||
--
|
||||
2.49.0
|
||||
|
Reference in New Issue
Block a user