Project

General

Profile

Download (2.37 KB) Statistics
| Branch: | Tag: | Revision:
<%#
kind: PXELinux
name: Kickstart default PXELinux
model: ProvisioningTemplate
oses:
- CentOS
- Fedora
- RedHat
-%>
# This file was deployed via '<%= template_name %>' template

<%
major = @host.operatingsystem.major.to_i
mac = @host.provision_interface.mac

# Tell Anaconda to perform network functions with boot interface
# both current and legacy syntax provided
options = ["network", "ksdevice=bootif", "ks.device=bootif"]
if mac
bootif = '00-' + mac.gsub(':', '-')
options.push("BOOTIF=#{bootif}")
end

# Tell Anaconda what to pass off to kickstart server
# both current and legacy syntax provided
options.push("kssendmac", "ks.sendmac", "inst.ks.sendmac")

# handle non-DHCP environments (e.g. bootdisk)
subnet = @host.provision_interface.subnet
unless subnet.dhcp_boot_mode?
# static network configuration
ip = @host.provision_interface.ip
mask = subnet.mask
gw = subnet.gateway
dns = [subnet.dns_primary]
if subnet.dns_secondary != ''
dns.push(subnet.dns_secondary)
end
if (@host.operatingsystem.name.match(/Fedora/i) && major < 17) || major < 7
# old Anacoda found in Fedora 16 or RHEL 6 and older
dns_servers = dns.join(',')
options.push("ip=#{ip}", "netmask=#{mask}", "gateway=#{gw}", "dns=#{dns_servers}")
else
options.push("ip=#{ip}::#{gw}:#{mask}:::none")
dns.each { |server|
options.push("nameserver=#{server}")
}
end
end

# optional repository for Atomic
if @host.operatingsystem.name.match(/Atomic/i)
options.push("inst.repo=#{medium_uri}")
end

if @host.operatingsystem.name.match(/Atomic/i) || host_param('kickstart_liveimg')
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
-%>

DEFAULT menu
MENU TITLE Booting into OS installer (ESC to stop)
TIMEOUT <%= timeout %>
ONTIMEOUT installer

LABEL installer
MENU LABEL <%= template_name %>
KERNEL <%= @kernel %>
APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
IPAPPEND 2

<%= snippet_if_exists(template_name + " custom menu") %>
(5-5/15)