Bug 2178995

Summary: [RFE] Extend the ("Install Errata - Katello SSH Default") job template to identify services that needs to be restarted after installing patches
Product: Red Hat Satellite Reporter: momran
Component: Remote ExecutionAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.10.7CC: aruzicka, dsinglet
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description momran 2023-03-16 12:07:24 UTC
Description of problem:

On Red Hat Satellite 6.10, customer is using the ("Install Errata - Katello SSH Default") job template to patch their content hosts. After the patches have been installed, customer uses the following command to identify the services that need to be restarted:
   ~~~
   # hammer host traces resolve --async --host-id ${HOST_ID} --trace-ids ${TRACE_IDS}
   ~~~

Customer requests that the ("Install Errata - Katello SSH Default") job template be extended so that it is capable of:

  1. Identifying the services that need to be restarted after patching the host, and restart them.
     Similarly to:
      ~~~
      # TRACE_IDS_LIST=( $(hammer --output=csv --no-headers host traces list --host-id "${HOST_ID}") )
      # TRACE_IDS="$(echo ${TRACE_IDS_LIST[@]} | tr '[[:space:]]' ',' | sed 's/,$//g')"
hammer host traces resolve --async --host-id ${HOST_ID} --trace-ids ${TRACE_IDS}
      ~~~

  2. Recognizing whether a reboot of the patched host is needed or not, and if it is needed, reboot the host.


Version-Release number of selected component (if applicable):

Red Hat Satellite 6.10

Comment 1 Adam Ruzicka 2023-03-17 10:42:16 UTC
For newer EL*, there's dnf needs-restarting plugin which we could probably use. Considering it comes from dnf-plugins-core package, I'd hope we can rely on it being available