Compare commits
1 Commits
03a9af8ceb
...
aaf1380c59
Author | SHA1 | Date |
---|---|---|
Philippe Caseiro | aaf1380c59 |
|
@ -71,7 +71,8 @@ locals {
|
||||||
BootingMessage = "Booting from network the Cadoles way"
|
BootingMessage = "Booting from network the Cadoles way"
|
||||||
DHCPRangeStart = ""
|
DHCPRangeStart = ""
|
||||||
DHCPRangeEnd = ""
|
DHCPRangeEnd = ""
|
||||||
DHCPLeaseDuration = "12h"
|
DHCPLeaseDuration = "1h"
|
||||||
|
TFTPRoot = "/var/lib/tftpboot"
|
||||||
}
|
}
|
||||||
MatchBox = {
|
MatchBox = {
|
||||||
Hostname = "mb.cadoles.com"
|
Hostname = "mb.cadoles.com"
|
||||||
|
|
|
@ -47,6 +47,12 @@ EOF
|
||||||
destination = "/etc/local.d/initmatchbox.start"
|
destination = "/etc/local.d/initmatchbox.start"
|
||||||
source = "${local.locations.provisionning}/conf/${build.name}/initmatchbox.start"
|
source = "${local.locations.provisionning}/conf/${build.name}/initmatchbox.start"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy tftp provisionning script
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "/etc/local.d/inittftp.start"
|
||||||
|
source = "${local.locations.provisionning}/conf/${build.name}/inittftp.start"
|
||||||
|
}
|
||||||
|
|
||||||
// Generate default configuration for kubernetes
|
// Generate default configuration for kubernetes
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
|
@ -79,6 +85,7 @@ EOF
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
"chmod +x /etc/local.d/initmatchbox.start",
|
"chmod +x /etc/local.d/initmatchbox.start",
|
||||||
|
"chmod +x /etc/local.d/inittftp.start",
|
||||||
"chmod +x /etc/one-context.d/net-96-templater"
|
"chmod +x /etc/one-context.d/net-96-templater"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
dest="${1}"
|
||||||
|
|
||||||
|
ipxeEFISource="http://boot.ipxe.org/ipxe.efi"
|
||||||
|
kpxeSource="http://boot.ipxe.org/undionly.kpxe"
|
||||||
|
|
||||||
|
cd "${dest}"
|
||||||
|
wget "${ipxeEFISource}"
|
||||||
|
wget "${kpxeSource}"
|
|
@ -13,22 +13,25 @@ strict-order
|
||||||
addn-hosts=/etc/dnsmasq-hosts.conf
|
addn-hosts=/etc/dnsmasq-hosts.conf
|
||||||
domain=${Vars.PXE.DNSDomain}
|
domain=${Vars.PXE.DNSDomain}
|
||||||
local=/${Vars.PXE.DNSDomain}/
|
local=/${Vars.PXE.DNSDomain}/
|
||||||
|
localise-queries
|
||||||
|
|
||||||
|
|
||||||
enable-tftp
|
|
||||||
|
|
||||||
pxe-prompt="${Vars.PXE.GreetingMessage}",${Vars.PXE.DelayTime}
|
|
||||||
pxe-service=X86PC,"${Vars.PXE.BootingMessage}", http://${Vars.ETH0.IP}:${Vars.MatchBox.HTTPPort}/boot.ipxe
|
|
||||||
|
|
||||||
%{ if Vars.PXE.DHCPMode == "proxy" }
|
%{ if Vars.PXE.DHCPMode == "proxy" }
|
||||||
dhcp-no-override
|
#dhcp-no-override
|
||||||
dhcp-range=${Vars.ETH0.IP},proxy
|
dhcp-range=${Vars.ETH0.IP},proxy
|
||||||
%{ else }
|
%{ else }
|
||||||
dhcp-range=${Vars.PXE.DHCPRangeStart},${Vars.PXE.DHCPRangeEnd},${Vars.PXE.DHCPLeaseDuration}
|
dhcp-range=${Vars.PXE.DHCPRangeStart},${Vars.PXE.DHCPRangeEnd},${Vars.PXE.DHCPLeaseDuration}
|
||||||
dhcp-option=option:router,${Vars.ETH0.Gateway}
|
dhcp-option=option:router,${Vars.ETH0.GATEWAY}
|
||||||
%{ endif }
|
%{ endif }
|
||||||
|
|
||||||
dhcp-option=option:dns-server,${Vars.ETH0.IP}
|
dhcp-option=option:dns-server,${Vars.ETH0.IP}
|
||||||
dhcp-option=option:domain-name,${Vars.PXE.DNSDomain}
|
dhcp-option=option:domain-name,${Vars.PXE.DNSDomain}
|
||||||
|
|
||||||
dhcp-match=set:ipxe,175
|
# TFTP Configuration
|
||||||
dhcp-vendorclass=BIOS,PXEClient:Arch:00000
|
enable-tftp
|
||||||
|
tftp-root="${Vars.PXE.TFTPRoot}"
|
||||||
|
|
||||||
|
pxe-prompt="${Vars.PXE.GreetingMessage}",${Vars.PXE.DelayTime}
|
||||||
|
pxe-service=tag:#ipxe,x86PC,"Legacy boot PXE chainload to iPXE",undionly.kpxe
|
||||||
|
dhcp-userclass=set:ipxe,iPXE
|
||||||
|
pxe-service=tag:ipxe,x86PC,"${Vars.PXE.BootingMessage} (iPXE)", http://${Vars.ETH0.IP}:${Vars.MatchBox.HTTPPort}/boot.ipxe
|
Loading…
Reference in New Issue