sap_swpm: Add Pseudo-Idempotency - #1213
Open
marcelmamula wants to merge 4 commits into
Open
Conversation
Contributor
Author
|
Moved back to draft, because I found much safer way for detection and I will be updating it. |
marcelmamula
marked this pull request as ready for review
May 20, 2026 14:49
Contributor
Author
|
Whole workflow was redone to align with much complex and strict detection. This will cover all scenarios, without allowing relaxed detection that was in original PR. |
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Premise
We have been tip toing around this subject for far too long and it is time we fix this. I was discussing this during my presentation at SUSECON26 two weeks ago and I found time to consolidate all points from our discussion #1005 into working code, that implements Pseudo-Idempotency.
Pseudo-Idempotency definition
Implementation follows logic that I implemented in
sap_hana_installrole already:This is preventive detection to ensure existing SAP Systems are not destroyed, not fully idempotent code that ensures exact specific SAP Product is installed!
Changes
New
pre_install/detect_sap*.ymltask files added, which is started from withinpre_install/swpm_prepare.ymlin order to follow existing structure of tasks and tags. This file contains whole complex logic for detection and exceptions.New product based dictionaries in
vars/main.yml. These dictionaries are very complex, but commented in detail to simplify their management.User expiration post-task was split into dedicated tasks in separate file. This ensures that we do not blindly call
chageand mark it always as change. Note was added about potential use ofansible.builtin.user, but it requiresansible-core 2.18+.Update debug message blocks to align with rest of changes (remove lines since
pipeloads it line by line).Add new override variable
sap_swpm_force: falseand# sap_swpm_skip_detection: false.Detection Approach
New approach uses detection matrix:
Tests
Tested on SLES_SAP 16.0 using various different combinations:
NW_ABAP_CI,NW_ABAP_ASCS,NW_ABAP_ERS,NW_ABAP_OneHost,NW_ABAP_DB, or other invalid values.Examples of new informational tasks
SAP Instance was detected, proceeding to skip installation steps
No system was detected (just information that checks occured).
Enforced alignment of UID and GID, if variables are used.
Database Load product was detected, informing users that installation will proceed but it is all in hands of SWPM.
Bad SAP Product Catalog ID detected.
Missing section for known Product prefix
Adding @berndfinger @sean-freeman @rob0d @rhmk as original participants in our discussion #1005.