From time to time there are regression bugs in openSUSE Leap / SLES that result in a orphaned task during patch installation. As a result, the patch task is still in "Scheduled" or "Picked Up" state, even though some patches might have been installed - or not.
It would be good to install all package management stack updates first before installing all remaining patches.
This could be implemented as a parameter for the install_patches module, e.g. mgmt_stack_only.
Unfortunately, there is no API call for this in Uyuni - so we need to be more creative. It could be possible to filter for errata affecting the zypper, libzypp, salt-minion and venv-salt-minion packages.