forked from theforeman/community-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
kickstart_default_pxelinux.erb
69 lines (60 loc) · 1.99 KB
/
kickstart_default_pxelinux.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<%#
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=#{@host.operatingsystem.medium_uri(@host)}")
end
if host_param('blacklist')
options.push("modprobe.blacklist=" + host_param('blacklist').gsub(' ', ''))
end
ksoptions = options.join(' ')
-%>
TIMEOUT <%= host_param('loader_timeout') || 10 %>
DEFAULT <%= template_name %>
LABEL <%= template_name %>
KERNEL <%= @kernel %>
APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
IPAPPEND 2