Bug 1826648
Summary: | [RFE] new report template to list all the installed packages | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Waldirio M Pinheiro <wpinheir> |
Component: | Reporting | Assignee: | Waldirio M Pinheiro <wpinheir> |
Status: | CLOSED ERRATA | QA Contact: | Cole Higgins <chiggins> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.7.0 | CC: | afeferku, bkearney, mhulan, pcreech, vsedmik |
Target Milestone: | 6.13.0 | Keywords: | EasyFix, FutureFeature, Patch, Triaged |
Target Release: | Unused | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | foreman-3.5.0 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-05-03 13:20:33 UTC | 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
Waldirio M Pinheiro
2020-04-22 08:44:08 UTC
Hi Below the code --- $ cat host_-_all_installed_packages.erb <%# name: Host - All Installed Packages snippet: false template_inputs: - name: hosts required: false input_type: user advanced: false value_type: plain resource_type: Katello::ActivationKey hidden_value: false model: ReportTemplate %> <% load_hosts(search: input('hosts')).each_record do |host| -%> <% host.installed_packages.each do |pkg| -%> <%- report_row( 'Host': host.name, 'Package Name': pkg.name, 'Package NVRA': pkg.nvra, 'Package NVREA': pkg.nvrea )-%> <% end -%> <% end -%> <%= report_render -%> --- Ps.: This is running fine on Satellite 6.7, however, in 6.6 it's necessary to change the safemode to "No". Checking the backport possibility. Thank you! Waldirio Hello, Below the workaround, if the customer is looking for this kind of report There we are, now, let's automate this process to generate the same kind of information to all of your content hosts --- #!/bin/bash for b in $(hammer --csv --no-headers host list --thin 1 --search 'name !~ virt-who*' | cut -d, -f2) do for i in $(hammer --csv --no-headers host package list --host $b --search 'nvra ~ iptraf or yum or zlib') do echo "$b,$i" done done --- Cool, with the script above, we will get the output as below --- [root@wallsat66 installed_packages]# ./installed_packages.sh dhcp-8-29-139.lab.eng.rdu2.redhat.com,yum-3.4.3-158.el7.noarch dhcp-8-29-139.lab.eng.rdu2.redhat.com,yum-metadata-parser-1.1.4-10.el7.x86_64 dhcp-8-29-139.lab.eng.rdu2.redhat.com,yum-rhn-plugin-2.0.1-10.el7.noarch dhcp-8-29-139.lab.eng.rdu2.redhat.com,zlib-1.2.7-17.el7.x86_64 ... --- Upstream bug assigned to wpinheir Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/29590 has been resolved. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:2097 |