[PR #6534/a9fd9f89 backport][stable-6] added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED #6559
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.
This is a backport of PR #6534 as merged into main (a9fd9f8).
added handling of zypper exitcode 102: ZYPPER_EXIT_INF_REBOOT_NEEDED - Returned after a successful installation of a patch which requires reboot of computer.
SUMMARY
This code was not treated at all by the module and therefore considered a faillure and the changed status was never set.
After my fix the exitcode 102 will be treated exactly like 0 by the module internally, and the changed status will be reported correctly.
However, since I preserve the rc 102 in the retvals to allow the playbook to react to the requested reboot, the task must still include a "register" and a "failed_when" property to pass as OK in this event.
Example:
ISSUE TYPE
COMPONENT NAME
zypper
ADDITIONAL INFORMATION
When used to do updates of the type "patch" the zypper module failed in case the updates were successfull, but resulted in the system needing a reboot. In that case the changed status was not correctly set. After my fix the task will still be treated a faillure by ansible unless you treat the rc 102 in a failed_when statement as shown above, but the changed state will be correctly set.