Project

General

Profile

« Previous | Next » 

Revision 76731030

Added by Tomer Brisker over 5 years ago

templates - sync from community-templates

View differences:

app/views/unattended/provisioning_templates/PXEGrub/kickstart_default_pxegrub.erb
options.push("inst.repo=#{medium_uri}")
end
if host_param('kickstart_liveimg')
if @host.operatingsystem.name.match(/Atomic/i) || host_param('kickstart_liveimg')
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
app/views/unattended/provisioning_templates/PXEGrub2/kickstart_default_pxegrub2.erb
options.push("inst.repo=#{medium_uri}")
end
if host_param('kickstart_liveimg')
if @host.operatingsystem.name.match(/Atomic/i) || host_param('kickstart_liveimg')
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
app/views/unattended/provisioning_templates/PXELinux/kickstart_default_pxelinux.erb
options.push("inst.repo=#{medium_uri}")
end
if host_param('kickstart_liveimg')
if @host.operatingsystem.name.match(/Atomic/i) || host_param('kickstart_liveimg')
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
app/views/unattended/provisioning_templates/finish/kickstart_default_finish.erb
<%= snippet 'redhat_register' %>
<% if host_enc['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
<% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
<%= snippet 'freeipa_register' %>
<% end -%>
app/views/unattended/provisioning_templates/provision/atomic_kickstart_default.erb
# Use medium_uri/content/repo/ as the URL if you
# have set up a local installation media for Fedora
<% fedora_atomic_url = host_param('atomic_refs_url') || "https://dl.fedoraproject.org/pub/fedora/linux/atomic/#{@host.os.major}/" %>
ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=<%= fedora_atomic_url %> --ref=fedora-atomic/f<%= @host.os.major %>/<%= @host.architecture %>/docker-host
ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic-ostree --url=<%= fedora_atomic_url %> --ref=fedora-atomic/f<%= @host.os.major %>/<%= @host.architecture %>/docker-host
<% elsif @host.os.name.match /.*centos.*/i -%>
ostreesetup --nogpg --osname=centos-atomic-host --remote=centos-atomic-host --url=<%= host_param_true?('atomic-upstream') ? "http://mirror.centos.org/centos/#{@host.os.major}/atomic/#{@host.architecture}/repo/" : medium_uri %> --ref=centos-atomic-host/<%= @host.os.major %>/<%= @host.architecture %>/standard
ostreesetup --nogpg --osname=centos-atomic-host --remote=centos-atomic-host-ostree --url=<%= host_param_true?('atomic-upstream') ? "http://mirror.centos.org/centos/#{@host.os.major}/atomic/#{@host.architecture}/repo/" : medium_uri %> --ref=centos-atomic-host/<%= @host.os.major %>/<%= @host.architecture %>/standard
<% else -%>
ostreesetup --nogpg --osname=rhel-atomic-host --remote=rhel-atomic-host --url=file:///install/ostree --ref=rhel-atomic-host/<%= @host.os.major %>/<%= @host.architecture %>/standard
ostreesetup --nogpg --osname=rhel-atomic-host --remote=rhel-atomic-host-ostree --url=file:///install/ostree --ref=rhel-atomic-host/<%= @host.os.major %>/<%= @host.architecture %>/standard
<% end -%>
services --disabled cloud-init,cloud-config,cloud-final,cloud-init-local
rootpw --iscrypted <%= root_pass %>
......
%post
<%= snippet 'redhat_register' %>
rm -f /etc/ostree/remotes.d/*.conf
<%= snippet('remote_execution_ssh_keys') %>
(
# Report success back to Foreman
app/views/unattended/provisioning_templates/user_data/kickstart_default_user_data.erb
<%= snippet 'redhat_register' %>
<% if host_enc['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
<% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
<%= snippet 'freeipa_register' %>
<% end -%>
app/views/unattended/report_templates/applicable_errata.erb
<%#
name: Applicable errata
snippet: false
template_inputs:
- name: Hosts filter
required: false
input_type: user
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
- name: Errata filter
required: false
input_type: user
description: Limit the report only on errata found by this search query. Keep empty
for report on all available errata.
advanced: false
model: ReportTemplate
require:
- plugin: katello
version: 3.9.0
-%>
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :applicable_errata, :lifecycle_environment]).each_record do |host| -%>
<%- host_applicable_errata_filtered(host, input('Errata filter')).each do |erratum| -%>
<%- report_row(
'Host': host.name,
'Operating System': host.operatingsystem,
'Environment': host.lifecycle_environment,
'Erratum': erratum.errata_id,
'Type': erratum.errata_type,
'Published': erratum.issued,
'Applicable since': erratum.created_at,
'Severity': erratum.severity,
'Packages': erratum.package_names,
'CVEs': erratum.cves,
'Reboot suggested': erratum.reboot_suggested,
) -%>
<%- end -%>
<%- end -%>
<%= report_render -%>
app/views/unattended/report_templates/host_statuses_csv.erb
<%#
name: Host statuses CSV
snippet: false
template_inputs:
- name: hosts
required: false
input_type: user
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
model: ReportTemplate
-%>
<%- load_hosts(includes: :host_statuses).each_record do |host| -%>
%>
<%- load_hosts(search: input('hosts'), includes: :host_statuses).each_record do |host| -%>
<%- report_row({
'Name': host.name,
'Global': host.global_status
app/views/unattended/report_templates/registered_hosts.erb
<%#
name: Registered hosts
snippet: false
template_inputs:
- name: Hosts filter
required: false
input_type: user
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
model: ReportTemplate
require:
- plugin: katello
 version: 3.9.0
-%>
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :subscriptions, :fact_values, :fact_names, :applicable_errata, :applicable_rpms]).each_record do |host| -%>
<%- report_row(
'Name': host.name,
'Ip': host.ip,
'Operating System': host.operatingsystem,
'Subscriptions': host_subscriptions(host),
'Applicable Errata': host_applicable_errata_ids(host),
'Owner': host.owner.login,
'Kernel': host.facts['kernelrelease'],
'Latest kernel available': host_latest_applicable_rpm_version(host, 'kernel')
) -%>
<%- end -%>
<%= report_render -%>
app/views/unattended/report_templates/subscriptions.erb
<%#
name: Subscriptions
snippet: false
template_inputs:
- name: Subscriptions filter
required: false
input_type: user
description: Search query to filter subscription entitlements. E.g. `quantity >
0` to exclude subscriptions with unlimited entitlements. Keep unset for all subscriptions.
advanced: false
model: ReportTemplate
require:
- plugin: katello
 version: 3.9.0
-%>
<%- load_pools(search: input('Subscriptions filter'), includes: [:subscription, :products]).each_record do |pool| -%>
<%- report_row(
'ID': pool.id,
'Name': pool.name,
'Available': pool.available,
'Quantity': pool.quantity,
'SKU': pool.product_id,
'Contract number': pool.contract_number,
) -%>
<%- end -%>
<%= report_render -%>

Also available in: Unified diff