Project

General

Profile

« Previous | Next » 

Revision d96043f5

Added by Tomer Brisker about 5 years ago

templates - sync from community-templates

View differences:

app/views/unattended/provisioning_templates/PXEGrub/kickstart_default_pxegrub.erb
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
if @host.operatingsystem.name != 'Fedora' && @host.operatingsystem.major.to_i >= 7 && host_param_true?('fips_enabled')
options.push('fips=1')
end
ksoptions = options.join(' ')
-%>
......
root (nd)
kernel (nd)/../<%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
initrd (nd)/../<%= @initrd %>
<%= snippet_if_exists(template_name + " custom menu") %>
app/views/unattended/provisioning_templates/PXEGrub2/kickstart_default_pxegrub2.erb
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
if @host.operatingsystem.name != 'Fedora' && @host.operatingsystem.major.to_i >= 7 && host_param_true?('fips_enabled')
options.push('fips=1')
end
# send PXELinux "IPAPPEND 2" option along
options.push("BOOTIF=01-$net_default_mac")
ksoptions = options.join(' ')
# efi grub commands are RHEL7+ only, this prevents "Kernel is too old"
if @host.operatingsystem.family == 'Redhat' && major < 7
# Grub EFI commands are RHEL7+ only (prevents "Kernel is too old") or for non-EFI arch
if (@host.operatingsystem.family == 'Redhat' && major < 7) || !@host.pxe_loader.include?('EFI')
linuxcmd = "linux"
initrdcmd = "initrd"
else
......
<%= linuxcmd %> <%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
<%= initrdcmd %> <%= @initrd %>
}
<%= snippet_if_exists(template_name + " custom menu") %>
app/views/unattended/provisioning_templates/PXEGrub2/preseed_default_pxegrub2.erb
linux<%= efi_suffix %> <%= @kernel %> interface=auto url=<%= foreman_url('provision')%> ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=<%= @host.name %> <%= options %>
initrd<%= efi_suffix %> <%= @initrd %>
}
<%= snippet_if_exists(template_name + " custom menu") %>
app/views/unattended/provisioning_templates/PXEGrub2/pxegrub2_default_local_boot.erb
set default=<%= global_setting("default_pxe_item_local", "local") %>
set timeout=20
echo Default PXE local template entry is set to '<%= global_setting("default_pxe_item_local", "local") %>'
<%= snippet "pxegrub2_mac" %>
<%= snippet "pxegrub2_chainload" %>
<%= snippet "pxegrub2_discovery" %>
app/views/unattended/provisioning_templates/PXEGrub2/pxegrub2_global_default.erb
default=<%= global_setting("default_pxe_item_global", "local") %>
timeout=20
echo Default PXE global template entry is set to '<%= global_setting("default_pxe_item_global", "local") %>'
# On Debian/Ubuntu grub2 does not have patch for loading MAC-based configs. Also due to bug
# in RHEL 7.4 files are loaded with an extra ":" character at the end. This workarounds both
# cases, make sure "regexp.mod" file is present on the TFTP. For more info see:
# https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
<%= snippet "pxegrub2_mac" %>
# Only grub2 from redhat has MAC-based config loading patch, load explicitly
configfile=/grub2/grub.cfg-01-$mac
source "$configfile"
# And if that fails render chain and discovery menu
<%= snippet "pxegrub2_chainload" %>
<%= snippet "pxegrub2_discovery" %>
<% unless @profiles.nil? -%>
app/views/unattended/provisioning_templates/PXELinux/kickstart_default_pxelinux.erb
options.push('inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s)
end
if @host.operatingsystem.name != 'Fedora' && @host.operatingsystem.major.to_i >= 7 && host_param_true?('fips_enabled')
options.push('fips=1')
end
ksoptions = options.join(' ')
timeout = host_param('loader_timeout').to_i * 10
timeout = 100 if timeout.nil? || timeout <= 0
......
KERNEL <%= @kernel %>
APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
IPAPPEND 2
<%= snippet_if_exists(template_name + " custom menu") %>
app/views/unattended/provisioning_templates/PXELinux/preseed_default_pxelinux.erb
KERNEL <%= @kernel %>
APPEND initrd=<%= @initrd %> interface=auto url=<%= foreman_url('provision')%> ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=<%= @host.name %> <%= options %>
IPAPPEND 2
<%= snippet_if_exists(template_name + " custom menu") %>
app/views/unattended/provisioning_templates/finish/preseed_default_finish.erb
/bin/hostname <%= @host.shortname %>.<%= @host.domain %>
<% end -%>
<%= snippet_if_exists(template_name + " custom snippet") %>
<% if host_enc['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
<%= snippet 'freeipa_register' %>
<% end -%>
......
<% end -%>
<%= snippet 'preseed_networking_setup' %>
<%= snippet 'efibootmgr_netboot' %>
<%= snippet 'built' %>
app/views/unattended/provisioning_templates/iPXE/ipxe_global_default.erb
:start
menu iPXE global boot menu
item --key l local Continue local boot
item --key l local Local boot (next entry)
item shell Drop into iPXE shell
item reboot Reboot system
item
item --key d discovery Foreman Discovery
item --key d discovery Discovery from ${next-server}:8000 (httpboot module)
item --key d discovery8448 Discovery from ${next-server}:8448 (httpboot module)
item --key d discovery80 Discovery from ${next-server}:80 (custom script)
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}
......
:discovery
dhcp
kernel ${next-server}/boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-${net0/mac}
initrd ${next-server}/boot/fdi-image/initrd0.img
kernel http://${next-server}:8000/boot/fdi-image/vmlinuz0 initrd=initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset nokaslr proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-${net0/mac}
initrd http://${next-server}:8000/boot/fdi-image/initrd0.img
imgstat
sleep 2
boot || goto failed
goto start
:discovery80
dhcp
kernel http://${next-server}/httpboot/boot/fdi-image/vmlinuz0 initrd=initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset nokaslr proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-${net0/mac}
initrd http://${next-server}/httpboot/boot/fdi-image/initrd0.img
imgstat
sleep 2
boot || goto failed
goto start
:discovery8000
dhcp
kernel http://${next-server}:8000/httpboot/boot/fdi-image/vmlinuz0 initrd=initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset nokaslr proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-${net0/mac}
initrd http://${next-server}:8000/httpboot/boot/fdi-image/initrd0.img
imgstat
sleep 2
boot || goto failed
goto start
app/views/unattended/provisioning_templates/iPXE/ipxe_intermediate_script.erb
-%>
#!ipxe
# Intermediate iPXE script to report MAC address to Foreman
<% (0..32).each do |i| -%>
:net<%= i %>
isset ${net<%= i -%>/mac} || goto no_nic
dhcp net<%= i -%> || goto net<%= i + 1 %>
chain <%= foreman_url('iPXE') %>?mac=${net<%= i -%>/mac} || goto net<%= i + 1 %>
dhcp net<%= i -%> || goto net<%= i+1 %>
chain <%= foreman_url('iPXE') %>?mac=${net<%= i -%>/mac} || goto net<%= i+1 %>
<% end -%>
:net33
goto no_nic
<% end %>
exit 0
:no_nic
app/views/unattended/provisioning_templates/iPXE/kickstart_default_ipxe.erb
<% stage2 = host_param('kickstart_liveimg') ? 'inst.stage2=' + @host.operatingsystem.medium_uri(@host).to_s : '' %>
kernel <%= "#{@host.url_for_boot(:kernel)}" %> initrd=initrd.img ks=<%= foreman_url('provision')%> inst.stage2=<%= @host.operatingsystem.medium_uri(@host) %> <%= stage2 %> <%= static %> ksdevice=<%= @host.mac %> network kssendmac ks.sendmac inst.ks.sendmac ip=${netX/ip} netmask=${netX/netmask} gateway=${netX/gateway} dns=${dns}
initrd <%= "#{@host.url_for_boot(:initrd)}" %>
<%- if @host.operatingsystem.name != 'Fedora' && @host.operatingsystem.major.to_i >= 7 && host_param_true?('fips_enabled') %>
<%- fips = 'fips=1' -%>
<%- else -%>
<%- fips = '' -%>
<%- end -%>
kernel <%= "#{@host.url_for_boot(:kernel)}" %> initrd=initrd.img ks=<%= foreman_url('provision')%> inst.stage2=<%= @host.operatingsystem.medium_uri(@host) %> <%= stage2 %> <%= static %> ksdevice=<%= @host.mac %> network kssendmac ks.sendmac inst.ks.sendmac ip=${netX/ip} netmask=${netX/netmask} gateway=${netX/gateway} dns=${dns} <%= fips %>
initrd <%= "#{@host.url_for_boot(:initrd)}" %>
imgstat
sleep 2
boot
app/views/unattended/provisioning_templates/provision/atomic_kickstart_default.erb
<%= snippet 'redhat_register' %>
rm -f /etc/ostree/remotes.d/*.conf
<%= snippet('remote_execution_ssh_keys') %>
<%= snippet 'efibootmgr_netboot' %>
(
# Report success back to Foreman
<%= snippet 'built' %>
app/views/unattended/provisioning_templates/provision/autoyast_default.erb
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || host_param_true?('force-puppet')
salt_enabled = host_param('salt_master') ? true : false
os_major = @host.operatingsystem.major.to_i
primary_interface_identifier = @host.primary_interface.identifier.blank? ? 'eth0' : @host.primary_interface.identifier
primary_interface_subnet = @host.primary_interface.subnet
-%>
......
</routing>
<% end -%>
</networking>
<%# NTP client configuration has incompatible changes in Leap 15 -%>
<% if os_major <= 12 || os_major == 42 -%>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
......
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<% else -%>
<ntp-client>
<ntp_policy>auto</ntp_policy>
<ntp_servers config:type="list">
<ntp_server>
<iburst config:type="boolean">false</iburst>
<address><%= host_param('ntp-server') || '0.opensuse.pool.ntp.org' %></address>
<offline config:type="boolean">true</offline>
</ntp_server>
</ntp_servers>
<ntp_sync>systemd</ntp_sync>
</ntp-client>
<% end -%>
<% if ! @dynamic -%>
<%= @host.diskLayout %>
<% end -%>
app/views/unattended/provisioning_templates/provision/kickstart_default.erb
- package_upgrade: boolean (default=true)
- disable-uek: boolean (default=false)
- use-ntp: boolean (default depends on OS release)
- fips_enabled: boolean (default=false)
%>
<%
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
......
<% end -%>
%packages
<%= snippet_if_exists(template_name + " custom packages") %>
yum
dhclient
<% if use_ntp -%>
......
<% if os_major >= 6 -%>
redhat-lsb-core
<% end -%>
<% if host_param_true?('fips_enabled') -%>
<%= snippet 'fips_packages' %>
<% end -%>
<% if salt_enabled %>
salt-minion
......
<% if @dynamic -%>
%pre
<%= snippet_if_exists(template_name + " custom pre") %>
<%= @host.diskLayout %>
<%= section_end -%>
<% end -%>
......
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= section_end -%>
%post
<%#
Main post script, if it fails the last post is still executed.
%>
%post --log=/mnt/sysimage/root/install.post.log
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
<%= snippet_if_exists(template_name + " custom post") %>
<% if subnet.respond_to?(:dhcp_boot_mode?) || @host.subnet6.respond_to?(:dhcp_boot_mode?) -%>
<%= snippet 'kickstart_networking_setup' %>
<% end -%>
......
<%= snippet('ansible_provisioning_callback') %>
sync
<%= snippet 'efibootmgr_netboot' %>
echo "Informing Foreman that we are built"
<%= snippet 'built' %>
) 2>&1 | tee /root/install.post.log
exit 0
touch /tmp/foreman_built
<%= section_end -%>
<%#
The last post section halts Anaconda to prevent endless loop
%>
<% if (is_fedora && os_major < 20) || (rhel_compatible && os_major < 7) -%>
%post
<% else -%>
%post --erroronfail
<% end -%>
if test -f /tmp/foreman_built; then
echo "calling home: build is done!"
<%= indent(2, skip1: true) { snippet('built', :variables => { :endpoint => 'built', :method => 'POST', :body_file => '/mnt/sysimage/root/install.post.log' }) } -%>
else
echo "calling home: build failed!"
<%= indent(2, skip1: true) { snippet('built', :variables => { :endpoint => 'failed', :method => 'POST', :body_file => '/mnt/sysimage/root/install.post.log' }) } -%>
fi
sync
<%= section_end -%>
app/views/unattended/provisioning_templates/provision/kickstart_ovirt.erb
nodectl init
<%= snippet 'redhat_register' %>
<%= snippet 'kickstart_networking_setup' %>
<%= snippet 'efibootmgr_netboot' %>
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc
app/views/unattended/provisioning_templates/provision/preseed_default.erb
%>
<%
proxy_string = host_param('http-proxy') ? " http://#{host_param('http-proxy')}:#{host_param('http-proxy-port')}" : ''
ansible_enabled = plugin_present?('foreman_ansible')
salt_enabled = host_param('salt_master') ? true : false
os_major = @host.operatingsystem.major.to_i
squeeze_or_older = (@host.operatingsystem.name == 'Debian' && os_major <= 6)
additional_packages = ['lsb-release']
additional_packages << host_param('additional-packages')
additional_packages << 'python' if ansible_enabled
additional_packages << 'salt-minion' if salt_enabled
additional_packages = additional_packages.join(" ").split().uniq().join(" ")
%>
# Locale
d-i debian-installer/locale string <%= host_param('lang') || 'en_US' %>
......
tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
# Install some base packages
d-i pkgsel/include string <%= salt_package %> lsb-release
d-i pkgsel/include string <%= additional_packages %>
d-i pkgsel/update-policy select <%= host_param('preseed-update-policy') || 'unattended-upgrades' %>
d-i pkgsel/upgrade select <%= host_param('preseed-post-install-upgrade') || 'none' %>
app/views/unattended/provisioning_templates/snippet/_built.erb
Tries curl, if not found then wget and finally wget from busybox (limited options).
-%>
<%
url = foreman_url('built')
endpoint = @endpoint || 'built'
method = @method || 'POST'
url = foreman_url(endpoint)
curl_opts = ["-H 'Content-Type: text/plain'"]
wget_opts = ["--header 'Content-Type: text/plain'"]
if url.start_with?('https')
curl_opts = "--insecure"
wget_opts = "--no-check-certificate"
else
curl_opts = ""
wget_opts = ""
curl_opts << "--insecure"
wget_opts << "--no-check-certificate"
end
if @body_file
curl_opts << "--data @#{@body_file}"
wget_opts << "--body-file=#{@body_file}"
end
-%>
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* <%= curl_opts %> --silent '<%= url %>'
/usr/bin/curl -o /dev/null --noproxy \* <%= curl_opts.join(' ') %> --silent '<%= url %>'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy <%= wget_opts %> '<%= url %>'
/usr/bin/wget -q -O /dev/null --no-proxy --method <%= method %> <%= wget_opts.join(' ') %> '<%= url %>'
else
wget -q -O /dev/null '<%= url %>'
wget -q -O /dev/null --header 'Content-Type: text/plain' '<%= url %>'
fi
app/views/unattended/provisioning_templates/snippet/_coreos_cloudconfig.erb
command: restart
<% end -%>
<% end -%>
hostname: <%= @host.name %>
<% if host_param('ssh_authorized_keys') -%>
ssh_authorized_keys:
<% host_param('ssh_authorized_keys').split(',').map{ |item| item.strip }.each do |ssh_key| -%>
app/views/unattended/provisioning_templates/snippet/_efibootmgr_netboot.erb
<%#
kind: snippet
name: efibootmgr_netboot
model: ProvisioningTemplate
description: Configure booting from network in EFI
snippet: true
%>
<% if host_param('efi_bootentry') == 'previous' -%>
if [[ -d /sys/firmware/efi ]]; then
echo "Changing EFI boot order to preserve boot. Typically the previous entry"
echo "was network boot in netboot workflows but this can also break things."
echo "In that case use efi_keep_bootorder host parameter to keep it untouched."
echo "Boot order is currently:"
efibootmgr
echo
created_entry=$(efibootmgr | grep "BootOrder" | cut -d " " -f 2 | cut -d "," -f 1)
others=$(efibootmgr | grep "BootOrder" | cut -d " " -f 2 | cut -d "," -f 2-)
new_order="${others},${created_entry}"
echo "Found entry ${created_entry}, changing order to:"
efibootmgr -o ${new_order}
echo
fi
<% elsif (entry = host_param('efi_bootentry')) -%>
if [[ -d /sys/firmware/efi ]]; then
echo "Trying to find EFI boot entry containing: <%= entry -%>"
echo "Boot order is currently:"
efibootmgr
echo
current=$(efibootmgr | grep "BootOrder" | cut -d " " -f 2)
id=$(efibootmgr | grep -E '^Boot[0-9]+' | grep -E 'a' | efibootmgr | grep -E '^Boot[0-9]+' | grep -E '<%= entry -%>' | cut -c5-8)
echo "Found entry ${id}, changing order to:"
efibootmgr -o ${id},${current}
echo
fi
<% end -%>
app/views/unattended/provisioning_templates/snippet/_fips_packages.erb
<%#
kind: snippet
name: fips_packages
model: ProvisioningTemplate
snippet: true
%>
dracut-fips
-prelink
app/views/unattended/provisioning_templates/snippet/_puppet.conf.erb
logdir = <%= log_dir %>
rundir = <%= run_dir %>
ssldir = <%= ssl_dir %>
<% if host_param_true?('fips_enabled') -%>
digest_algorithm = sha256
<% end -%>
[agent]
pluginsync = true
app/views/unattended/provisioning_templates/snippet/_pxegrub2_chainload.erb
paths.each do |path|
-%>
echo "Trying <%= path %> "
unset root
search --file --no-floppy --set=root <%= path %>
if [ -f ($root)<%= path %> ]; then
chainloader ($root)<%= path %>
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot <%= path %>
if [ -f ($chroot)<%= path %> ]; then
chainloader ($chroot)<%= path %>
echo "Found <%= path %> at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
<%
end
-%>
echo Partition with known EFI file not found, update 'pxegrub2_chainload' template.
echo Partition with known EFI file not found, you may want to drop to grub shell
echo and investigate available files updating 'pxegrub2_chainload' template and
echo the list of known filepaths for probing. Contents of \EFI directory:
ls ($chroot)/EFI
echo The system will halt in 2 minutes or press ESC to halt immediately.
sleep -i 120
halt --no-apm
app/views/unattended/provisioning_templates/snippet/_pxegrub2_discovery.erb
the global template we have a regexp module creating corrected variable $mac
which is used here. See RHBZ#1487107 for more info.
-%>
menuentry 'Foreman Discovery Image' --id discovery {
linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-$mac
initrdefi boot/fdi-image/initrd0.img
<% ["efi", ""].each do |suffix| %>
menuentry 'Foreman Discovery Image <%= suffix %>' --id discovery<%= suffix %> {
linux<%= suffix %> boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-$mac
initrd<%= suffix %> boot/fdi-image/initrd0.img
}
<% end %>
app/views/unattended/provisioning_templates/snippet/_pxegrub2_mac.erb
<%#
kind: snippet
name: pxegrub2_mac
model: ProvisioningTemplate
snippet: true
-%>
# To load MAC-based config explicitly, a MAC address separated by dash chars is needed.
# Also due to bug in RHEL 7.4 files are loaded with an extra ":" character at the end.
# This workarounds both cases, make sure "regexp.mod" file is present on the TFTP.
# For more info see: https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
app/views/unattended/provisioning_templates/snippet/_pxegrub_discovery.erb
-%>
# http://projects.theforeman.org/issues/15997
title Foreman Discovery Image - not supported with Grub 1.x
kernel boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-$net_default_mac
kernel boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-$net_default_mac
initrd boot/fdi-image/initrd0.img
app/views/unattended/provisioning_templates/snippet/_pxelinux_discovery.erb
LABEL discovery
MENU LABEL Foreman Discovery Image
KERNEL boot/fdi-image/vmlinuz0
APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman
APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman
IPAPPEND 2
<%#
Chainbooting via iPXE requires an extra script published via HTTP:
#!ipxe
kernel http://foreman_url/pub/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=https://foreman_url proxy.type=foreman BOOTIF=01-${net0/mac}
kernel http://foreman_url/pub/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=https://foreman_url proxy.type=foreman BOOTIF=01-${net0/mac}
initrd http://foreman_url/pub/initrd0.img
boot
-%>
app/views/unattended/provisioning_templates/snippet/_redhat_register.erb
name: redhat_register
model: ProvisioningTemplate
snippet: true
-%>
<%#
# Red Hat Registration Snippet
#
# General parameters:
......
# subscription_manager_repos = <repos> Additional repositories to enable
# after registration
#
# subscription_manager_override_repos_cost = <cost> Override repository cost
#
# subscription_manager_pool = <pool> Specific subscription pool to use
#
# http-proxy = <host> Proxy hostname to be used for registration
......
<%= "subscription-manager repos --enable #{host_param('subscription_manager_repos').gsub(',', ' --enable')}" %>
<% end %>
<% if host_param('subscription_manager_override_repos_cost') %>
for repo in $(subscription-manager repos --list-enabled | grep "Repo ID:" | awk -F' ' '{ print $3 }'); do
<%= "subscription-manager repo-override --list --repo $repo | grep 'cost:' &>/dev/null || subscription-manager repo-override --repo $repo --add=cost:#{host_param('subscription_manager_override_repos_cost')}" %>
done
<% end %>
<% if !atomic %>
<% if redhat_install_agent || redhat_install_host_tools || redhat_install_host_tracer_tools %>
if [ -f /usr/bin/dnf ]; then
app/views/unattended/report_templates/applicable_errata.erb
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
value_type: search
resource_type: Host
- name: Errata filter
required: false
input_type: user
app/views/unattended/report_templates/applied_errata.erb
<%#
name: Applied Errata
snippet: false
template_inputs:
- name: Filter Errata Type
required: false
input_type: user
description: Filter only errata of a given type. If you select all, errata are not
filtered by type.
options: "all\r\nsecurity\r\nbugfix\r\nrecommended\r\nenhancement\r\noptional"
advanced: false
- name: Include Last Reboot
required: false
input_type: user
description: Last reboot information is based on configuration management facts,
such as uptime reported by Puppet or Ansible. The computation might be performance
heavy, if this value is not interesting, it can be omitted by choosing no.
options: "yes\r\nno"
advanced: false
- name: Status
required: false
input_type: user
description: Limit the search based on the application result.
options: "success\r\nwarning\r\nerror\r\ncancelled\r\npending"
advanced: false
- name: Since
required: false
input_type: user
description: Date and time since when to search for errata applications, use any
format supported by the search engine, e.g. "3 weeks ago" or "2019-03-28 10:00:00
+0100". If time zone is not specified, current user time zone is used.
By default, the search is unlimited.
advanced: false
value_type: date
- name: Up to
required: false
input_type: user
description: Date and time to search errata applications up to, use any format supported
by the search engine, e.g. "3 weeks ago" or "2019-03-28 10:00:00 +0100". If time zone
is not specified, current user time zone is used. By default, the search is unlimited.
advanced: false
value_type: date
model: ReportTemplate
require:
- plugin: katello
version: 3.12.0
-%>
<%- load_errata_applications(filter_errata_type: input('Filter Errata Type'),
include_last_reboot: input('Include Last Reboot'),
since: input('Since'),
up_to: input('Up to'),
status: input('Status')
).each do |info| -%>
<%- report_row(info) -%>
<%- end -%>
<%= report_render -%>
app/views/unattended/report_templates/host_statuses.erb
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
value_type: search
resource_type: Host
model: ReportTemplate
-%>
<%- load_hosts(search: input('hosts'), includes: :host_statuses).each_record do |host| -%>
app/views/unattended/report_templates/registered_hosts.erb
description: Limit the report only on hosts found by this search query. Keep empty
for report on all available hosts.
advanced: false
value_type: search
resource_type: Host
model: ReportTemplate
require:
- plugin: katello
 version: 3.9.0
-%>
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :subscriptions, :kernel_release, :interfaces, :owner, :applicable_errata, :applicable_rpms]).each_record do |host| -%>
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :subscriptions, :interfaces, :applicable_errata], preload: [:kernel_release, :owner]).each_record do |host| -%>
<%- report_row(
'Name': host.name,
'Ip': host.ip,
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart default PXEGrub.snap.txt
root (nd)
kernel (nd)/../ ks=http://foreman.some.host.fqdn/unattended/provision network ksdevice=bootif ks.device=bootif BOOTIF=00-00-f0-54-1a-7e-e0 kssendmac ks.sendmac inst.ks.sendmac
initrd (nd)/../
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/PXEGrub global default.snap.txt
# http://projects.theforeman.org/issues/15997
title Foreman Discovery Image - not supported with Grub 1.x
kernel boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$net_default_mac
kernel boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$net_default_mac
initrd boot/fdi-image/initrd0.img
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart default PXEGrub2.snap.txt
linuxefi ks=http://foreman.some.host.fqdn/unattended/provision network ksdevice=bootif ks.device=bootif BOOTIF=00-00-f0-54-1a-7e-e0 kssendmac ks.sendmac inst.ks.sendmac BOOTIF=01-$net_default_mac
initrdefi
}
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/PXEGrub2 default local boot.snap.txt
set default=nil
set timeout=20
echo Default PXE local template entry is set to 'nil'
# To load MAC-based config explicitly, a MAC address separated by dash chars is needed.
# Also due to bug in RHEL 7.4 files are loaded with an extra ":" character at the end.
# This workarounds both cases, make sure "regexp.mod" file is present on the TFTP.
# For more info see: https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
insmod part_gpt
......
echo Chainloading Grub2 EFI from ESP, enabled devices for booting:
ls
echo "Trying /EFI/fedora/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/fedora/shim.efi
if [ -f ($root)/EFI/fedora/shim.efi ]; then
chainloader ($root)/EFI/fedora/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/fedora/shim.efi
if [ -f ($chroot)/EFI/fedora/shim.efi ]; then
chainloader ($chroot)/EFI/fedora/shim.efi
echo "Found /EFI/fedora/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/fedora/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/fedora/grubx64.efi
if [ -f ($root)/EFI/fedora/grubx64.efi ]; then
chainloader ($root)/EFI/fedora/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/fedora/grubx64.efi
if [ -f ($chroot)/EFI/fedora/grubx64.efi ]; then
chainloader ($chroot)/EFI/fedora/grubx64.efi
echo "Found /EFI/fedora/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/redhat/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/redhat/shim.efi
if [ -f ($root)/EFI/redhat/shim.efi ]; then
chainloader ($root)/EFI/redhat/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/redhat/shim.efi
if [ -f ($chroot)/EFI/redhat/shim.efi ]; then
chainloader ($chroot)/EFI/redhat/shim.efi
echo "Found /EFI/redhat/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/redhat/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/redhat/grubx64.efi
if [ -f ($root)/EFI/redhat/grubx64.efi ]; then
chainloader ($root)/EFI/redhat/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/redhat/grubx64.efi
if [ -f ($chroot)/EFI/redhat/grubx64.efi ]; then
chainloader ($chroot)/EFI/redhat/grubx64.efi
echo "Found /EFI/redhat/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/centos/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/centos/shim.efi
if [ -f ($root)/EFI/centos/shim.efi ]; then
chainloader ($root)/EFI/centos/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/centos/shim.efi
if [ -f ($chroot)/EFI/centos/shim.efi ]; then
chainloader ($chroot)/EFI/centos/shim.efi
echo "Found /EFI/centos/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/centos/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/centos/grubx64.efi
if [ -f ($root)/EFI/centos/grubx64.efi ]; then
chainloader ($root)/EFI/centos/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/centos/grubx64.efi
if [ -f ($chroot)/EFI/centos/grubx64.efi ]; then
chainloader ($chroot)/EFI/centos/grubx64.efi
echo "Found /EFI/centos/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/debian/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/debian/grubx64.efi
if [ -f ($root)/EFI/debian/grubx64.efi ]; then
chainloader ($root)/EFI/debian/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/debian/grubx64.efi
if [ -f ($chroot)/EFI/debian/grubx64.efi ]; then
chainloader ($chroot)/EFI/debian/grubx64.efi
echo "Found /EFI/debian/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/ubuntu/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/ubuntu/grubx64.efi
if [ -f ($root)/EFI/ubuntu/grubx64.efi ]; then
chainloader ($root)/EFI/ubuntu/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/ubuntu/grubx64.efi
if [ -f ($chroot)/EFI/ubuntu/grubx64.efi ]; then
chainloader ($chroot)/EFI/ubuntu/grubx64.efi
echo "Found /EFI/ubuntu/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/sles/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/sles/grubx64.efi
if [ -f ($root)/EFI/sles/grubx64.efi ]; then
chainloader ($root)/EFI/sles/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/sles/grubx64.efi
if [ -f ($chroot)/EFI/sles/grubx64.efi ]; then
chainloader ($chroot)/EFI/sles/grubx64.efi
echo "Found /EFI/sles/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/opensuse/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/opensuse/grubx64.efi
if [ -f ($root)/EFI/opensuse/grubx64.efi ]; then
chainloader ($root)/EFI/opensuse/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/opensuse/grubx64.efi
if [ -f ($chroot)/EFI/opensuse/grubx64.efi ]; then
chainloader ($chroot)/EFI/opensuse/grubx64.efi
echo "Found /EFI/opensuse/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/Microsoft/boot/bootmgfw.efi "
unset root
search --file --no-floppy --set=root /EFI/Microsoft/boot/bootmgfw.efi
if [ -f ($root)/EFI/Microsoft/boot/bootmgfw.efi ]; then
chainloader ($root)/EFI/Microsoft/boot/bootmgfw.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/Microsoft/boot/bootmgfw.efi
if [ -f ($chroot)/EFI/Microsoft/boot/bootmgfw.efi ]; then
chainloader ($chroot)/EFI/Microsoft/boot/bootmgfw.efi
echo "Found /EFI/Microsoft/boot/bootmgfw.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo Partition with known EFI file not found, update 'pxegrub2_chainload' template.
echo Partition with known EFI file not found, you may want to drop to grub shell
echo and investigate available files updating 'pxegrub2_chainload' template and
echo the list of known filepaths for probing. Contents of \EFI directory:
ls ($chroot)/EFI
echo The system will halt in 2 minutes or press ESC to halt immediately.
sleep -i 120
halt --no-apm
......
boot
}
menuentry 'Foreman Discovery Image efi' --id discoveryefi {
linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$mac
initrdefi boot/fdi-image/initrd0.img
}
menuentry 'Foreman Discovery Image ' --id discovery {
linux boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$mac
initrd boot/fdi-image/initrd0.img
}
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/PXEGrub2 global default.snap.txt
default=nil
timeout=20
echo Default PXE global template entry is set to 'nil'
# On Debian/Ubuntu grub2 does not have patch for loading MAC-based configs. Also due to bug
# in RHEL 7.4 files are loaded with an extra ":" character at the end. This workarounds both
# cases, make sure "regexp.mod" file is present on the TFTP. For more info see:
# https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
# To load MAC-based config explicitly, a MAC address separated by dash chars is needed.
# Also due to bug in RHEL 7.4 files are loaded with an extra ":" character at the end.
# This workarounds both cases, make sure "regexp.mod" file is present on the TFTP.
# For more info see: https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
# Only grub2 from redhat has MAC-based config loading patch, load explicitly
configfile=/grub2/grub.cfg-01-$mac
source "$configfile"
# And if that fails render chain and discovery menu
insmod part_gpt
insmod fat
......
echo Chainloading Grub2 EFI from ESP, enabled devices for booting:
ls
echo "Trying /EFI/fedora/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/fedora/shim.efi
if [ -f ($root)/EFI/fedora/shim.efi ]; then
chainloader ($root)/EFI/fedora/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/fedora/shim.efi
if [ -f ($chroot)/EFI/fedora/shim.efi ]; then
chainloader ($chroot)/EFI/fedora/shim.efi
echo "Found /EFI/fedora/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/fedora/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/fedora/grubx64.efi
if [ -f ($root)/EFI/fedora/grubx64.efi ]; then
chainloader ($root)/EFI/fedora/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/fedora/grubx64.efi
if [ -f ($chroot)/EFI/fedora/grubx64.efi ]; then
chainloader ($chroot)/EFI/fedora/grubx64.efi
echo "Found /EFI/fedora/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/redhat/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/redhat/shim.efi
if [ -f ($root)/EFI/redhat/shim.efi ]; then
chainloader ($root)/EFI/redhat/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/redhat/shim.efi
if [ -f ($chroot)/EFI/redhat/shim.efi ]; then
chainloader ($chroot)/EFI/redhat/shim.efi
echo "Found /EFI/redhat/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/redhat/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/redhat/grubx64.efi
if [ -f ($root)/EFI/redhat/grubx64.efi ]; then
chainloader ($root)/EFI/redhat/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/redhat/grubx64.efi
if [ -f ($chroot)/EFI/redhat/grubx64.efi ]; then
chainloader ($chroot)/EFI/redhat/grubx64.efi
echo "Found /EFI/redhat/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/centos/shim.efi "
unset root
search --file --no-floppy --set=root /EFI/centos/shim.efi
if [ -f ($root)/EFI/centos/shim.efi ]; then
chainloader ($root)/EFI/centos/shim.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/centos/shim.efi
if [ -f ($chroot)/EFI/centos/shim.efi ]; then
chainloader ($chroot)/EFI/centos/shim.efi
echo "Found /EFI/centos/shim.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/centos/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/centos/grubx64.efi
if [ -f ($root)/EFI/centos/grubx64.efi ]; then
chainloader ($root)/EFI/centos/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/centos/grubx64.efi
if [ -f ($chroot)/EFI/centos/grubx64.efi ]; then
chainloader ($chroot)/EFI/centos/grubx64.efi
echo "Found /EFI/centos/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/debian/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/debian/grubx64.efi
if [ -f ($root)/EFI/debian/grubx64.efi ]; then
chainloader ($root)/EFI/debian/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/debian/grubx64.efi
if [ -f ($chroot)/EFI/debian/grubx64.efi ]; then
chainloader ($chroot)/EFI/debian/grubx64.efi
echo "Found /EFI/debian/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/ubuntu/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/ubuntu/grubx64.efi
if [ -f ($root)/EFI/ubuntu/grubx64.efi ]; then
chainloader ($root)/EFI/ubuntu/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/ubuntu/grubx64.efi
if [ -f ($chroot)/EFI/ubuntu/grubx64.efi ]; then
chainloader ($chroot)/EFI/ubuntu/grubx64.efi
echo "Found /EFI/ubuntu/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/sles/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/sles/grubx64.efi
if [ -f ($root)/EFI/sles/grubx64.efi ]; then
chainloader ($root)/EFI/sles/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/sles/grubx64.efi
if [ -f ($chroot)/EFI/sles/grubx64.efi ]; then
chainloader ($chroot)/EFI/sles/grubx64.efi
echo "Found /EFI/sles/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/opensuse/grubx64.efi "
unset root
search --file --no-floppy --set=root /EFI/opensuse/grubx64.efi
if [ -f ($root)/EFI/opensuse/grubx64.efi ]; then
chainloader ($root)/EFI/opensuse/grubx64.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/opensuse/grubx64.efi
if [ -f ($chroot)/EFI/opensuse/grubx64.efi ]; then
chainloader ($chroot)/EFI/opensuse/grubx64.efi
echo "Found /EFI/opensuse/grubx64.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo "Trying /EFI/Microsoft/boot/bootmgfw.efi "
unset root
search --file --no-floppy --set=root /EFI/Microsoft/boot/bootmgfw.efi
if [ -f ($root)/EFI/Microsoft/boot/bootmgfw.efi ]; then
chainloader ($root)/EFI/Microsoft/boot/bootmgfw.efi
echo "Found Grub2 at $root"
unset chroot
search --file --no-floppy --set=chroot /EFI/Microsoft/boot/bootmgfw.efi
if [ -f ($chroot)/EFI/Microsoft/boot/bootmgfw.efi ]; then
chainloader ($chroot)/EFI/Microsoft/boot/bootmgfw.efi
echo "Found /EFI/Microsoft/boot/bootmgfw.efi at $chroot, attempting to chainboot it..."
sleep 2
boot
fi
echo Partition with known EFI file not found, update 'pxegrub2_chainload' template.
echo Partition with known EFI file not found, you may want to drop to grub shell
echo and investigate available files updating 'pxegrub2_chainload' template and
echo the list of known filepaths for probing. Contents of \EFI directory:
ls ($chroot)/EFI
echo The system will halt in 2 minutes or press ESC to halt immediately.
sleep -i 120
halt --no-apm
......
}
menuentry 'Foreman Discovery Image' --id discovery {
linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$mac
menuentry 'Foreman Discovery Image efi' --id discoveryefi {
linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$mac
initrdefi boot/fdi-image/initrd0.img
}
menuentry 'Foreman Discovery Image ' --id discovery {
linux boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman BOOTIF=01-$mac
initrd boot/fdi-image/initrd0.img
}
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Preseed default PXEGrub2.snap.txt
linux interface=auto url=http://foreman.some.host.fqdn/unattended/provision ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=snapshothost console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true locale=en_US BOOTIF=01-$net_default_mac
initrd
}
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart default PXELinux.snap.txt
KERNEL
APPEND initrd= ks=http://foreman.some.host.fqdn/unattended/provision network ksdevice=bootif ks.device=bootif BOOTIF=00-00-f0-54-1a-7e-e0 kssendmac ks.sendmac inst.ks.sendmac
IPAPPEND 2
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/PXELinux global default.snap.txt
LABEL discovery
MENU LABEL Foreman Discovery Image
KERNEL boot/fdi-image/vmlinuz0
APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman
APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nokaslr nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman
IPAPPEND 2
LABEL discovery_ipxe
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Preseed default PXELinux.snap.txt
KERNEL
APPEND initrd= interface=auto url=http://foreman.some.host.fqdn/unattended/provision ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=snapshothost console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true locale=en_US
IPAPPEND 2
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/finish/Alterator default finish.snap.txt
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server --no-daemonize
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
/sbin/chkconfig puppetd on
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/finish/Preseed default finish.snap.txt
# SSH keys setup snippet for Remote Execution plugin
#
# Parameters:
......
EOF
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/finish/XenServer default finish.snap.txt
#!/bin/bash
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/iPXE intermediate script.snap.txt
dhcp net32 || goto net33
chain http://foreman.some.host.fqdn/unattended/iPXE?mac=${net32/mac} || goto net33
:net33
goto no_nic
exit 0
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/provision/Atomic Kickstart default.snap.txt
(
# Report success back to Foreman
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
) 2>&1 | tee /mnt/sysimage/root/install.post.log
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/provision/AutoYaST SLES default.snap.txt
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/provision/AutoYaST default.snap.txt
<interfaces config:type="list">
</interfaces>
</networking>
<ntp-client>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
......
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/curl -o /dev/null --noproxy \* -H 'Content-Type: text/plain' --silent 'http://foreman.some.host.fqdn/unattended/built'
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy 'http://foreman.some.host.fqdn/unattended/built'
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
else
wget -q -O /dev/null 'http://foreman.some.host.fqdn/unattended/built'
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.some.host.fqdn/unattended/built'
fi
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/provision/CoreOS provision.snap.txt
command: start
- name: fleet.service
command: start
hostname: snapshothost
users:
- name: core
passwd: xybxa6JUkz63w
test/unit/foreman/renderer/snapshots/ProvisioningTemplate/provision/Kickstart default.snap.txt
reboot
%packages
yum
dhclient
chrony
......
@Core
redhat-lsb-core
%end
%post --nochroot
......
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
%end
%post
%post --log=/mnt/sysimage/root/install.post.log
logger "Starting anaconda snapshothost postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
......
sync
echo "Informing Foreman that we are built"
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy \* --silent 'http://foreman.some.host.fqdn/unattended/built'
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff