-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #36826 - Add Host - Installed Products report
* Add system purpose role and usage to subscriptions entitlement report
- Loading branch information
Showing
3 changed files
with
89 additions
and
31 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
app/views/unattended/report_templates/host_-_installed_products.erb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<%# | ||
name: Host - Installed Products | ||
snippet: false | ||
model: ReportTemplate | ||
template_inputs: | ||
- name: Hosts filter | ||
required: false | ||
input_type: user | ||
description: Limit the report only on hosts found by this search query. Keep empty | ||
to report on all available hosts. | ||
advanced: false | ||
value_type: search | ||
resource_type: Host | ||
require: | ||
- plugin: katello | ||
version: 4.11.0 | ||
-%> | ||
<%- report_headers 'Host Name', 'Organization', 'Lifecycle Environment', 'Content View', 'Host Collections', 'Virtual', 'Guest of Host', 'OS', 'Arch', 'Sockets', 'RAM (MB)', 'Cores', 'SLA', 'Role', 'Usage', 'Release Version', 'Products', 'Last Checkin' -%> | ||
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :architecture, :content_view_environments, :organization, :reported_data, :subscription_facet]).each_record do |host| -%> | ||
<%- report_row( | ||
'Host Name': host.name, | ||
'Organization': host.organization, | ||
'Lifecycle Environment': host.single_lifecycle_environment, | ||
'Content View': host.single_content_view, | ||
'Host Collections': host_collections_names(host), | ||
'Virtual': host.virtual, | ||
'Guest of Host': host.hypervisor_host, | ||
'OS': host.operatingsystem, | ||
'Arch': host.architecture, | ||
'Sockets': host.sockets, | ||
'RAM (MB)': host.ram, | ||
'Cores': host.cores, | ||
'SLA': host_sla(host), | ||
'Role': host.purpose_role, | ||
'Usage': host.purpose_usage, | ||
'Release Version': host.release_version, | ||
'Products': host_products_names_and_ids(host), | ||
'Last Checkin': last_checkin(host).to_s, | ||
) -%> | ||
<%- end -%> | ||
<%= report_render -%> |
This file contains 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
10 changes: 10 additions & 0 deletions
10
db/migrate/20231016000000_introduce_host_products_report.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class IntroduceHostProductsReport < ActiveRecord::Migration[6.1] | ||
def up | ||
token = SecureRandom.base64(5) | ||
ReportTemplate.unscoped.find_by(name: "Host - Installed Products")&.update_columns(:name => "Host - Installed Products #{token}") | ||
end | ||
|
||
def down | ||
ReportTemplate.unscoped.find_by(name: "Host - Installed Products")&.destroy | ||
end | ||
end |