diff --git a/app/views/unattended/report_templates/host_-_vulnerabilities.erb b/app/views/unattended/report_templates/host_-_vulnerabilities.erb deleted file mode 100644 index 7d353eac93e..00000000000 --- a/app/views/unattended/report_templates/host_-_vulnerabilities.erb +++ /dev/null @@ -1,37 +0,0 @@ -<%# -name: Host - Vulnerabilities -snippet: false -model: ReportTemplate -template_inputs: -- name: Without Errata Only - required: true - input_type: user - description: Show only CVEs without errata for host - advanced: false - value_type: plain - options: "yes\r\nno" - default: "yes" -- name: Hosts filter - required: false - input_type: user - value_type: search - description: Limit the report only on hosts found by this search query. Keep - empty for report on all available hosts. - resource_type: Host -require: -- plugin: foreman_openscap - version: 4.3.0 --%> -<%- report_headers 'Host Name', 'Ref Id', 'Ref URL' -%> -<%- without_errata = input('Without Errata Only') == 'yes' %> -<%- load_hosts(includes: [:cves], search: input('Hosts filter')).each_record do |host| -%> -<%- scope = without_errata ? host.cves_without_errata : host.cves -%> -<%- scope.each do |cve| -%> -<%- report_row( - 'Host Name': host.name, - 'Ref Id': cve.ref_id, - 'Ref URL': cve.ref_url - ) -%> -<%- end -%> -<%- end -%> -<%= report_render -%> \ No newline at end of file diff --git a/db/migrate/20240529100345_drop_host_vulnerabilities_report_template.rb b/db/migrate/20240529100345_drop_host_vulnerabilities_report_template.rb new file mode 100644 index 00000000000..2cc117d9a8a --- /dev/null +++ b/db/migrate/20240529100345_drop_host_vulnerabilities_report_template.rb @@ -0,0 +1,7 @@ +class DropHostVulnerabilitiesReportTemplate < ActiveRecord::Migration[6.1] + def up + scope = ::Template.where(type: 'ReportTemplate', name: 'Host - Vulnerabilities') + ::TemplateInput.where(template_id: scope).delete_all + scope.delete_all + end +end