hy there, sorry for the delay, but hard job at this time.
so first thing i didn't change foreman's core, just made some change on
the provisioning files used for migration, to remove all unnecessary stuff
and add the one's needed for my organisation. by this way each new
installation is customised for me.
for the UEFI boot problems I've solved them with and awful but working
turnaround. As i m using a seed file to configure my foreman host ( host
provisioning, proxy, provision templates, media ,ldap source…everything)
during the 'seeding' i make a symbolic link from the hexadecimal ip adress
of the node to be deployed to the pxelinux.cfg/MACaddress and the default
build of my hosts is changed to be UEFI compliant.
part of my seeds.rb informations needed are retreived by parsing dhcp file
( dhcp only serve on pxe request), sorry if my code is not perfect but i m
supposed to be systems Engineer and not developer ^^
host = ligne.split (" ")
puts "#{host[1]} provisioning to foreman"
ip = host[7].chomp(';')
mac = host[5].chomp(';')
name = host[1]
# IP decimal to hexa translation
ip2=ip.split(".")
iphex1=ip2[0].to_i(10).to_s(16).upcase
iphex2=ip2[1].to_i(10).to_s(16).upcase
iphex3=ip2[2].to_i(10).to_s(16).upcase
iphex4=ip2[3].to_i(10).to_s(16).upcase
if iphex1.length == 1
iphex1="0#{iphex1}"
end
if iphex2.length == 1
iphex2="0#{iphex2}"
end
if iphex3.length == 1
iphex3="0#{iphex3}"
end
if iphex4.length == 1
iphex4="0#{iphex4}"
end
if name.include? "ws"
subnetShortName =
subnetName.split('@')[0].split(' ')
hostgroup = Hostgroup.select(:id).where(:name =>
"WORKSTATIONS #{subnetShortName[1]}").first.id
puts "#{name}
–#{subnetShortName[1]}— #{mac} ----#{ip}–#{ip2[2]}-#{hostgroup}"
else
hostgroup=
Hostgroup.select(:id).where(:subnet_id => "#{subnetNetworkID}").first.id
Dir.chdir("/var/lib/tftpboot/") do
File.symlink("pxelinux.cfg/01-#{mac.downcase.gsub(":","-")}","#{iphex1}#{iphex2}#{iphex3}#{iphex4}")
this part is the gate from UEFI to fake pxe
end
end
puts "#{name} ----- #{subnetNetworkID}
-mask>#{subnetMask}<–#{ip}–#{ip2[2]}–#{hostgroup}"
BOOTX.write("title Install #{name}"+"\n")
BOOTX.write("kernel
/images/pxeboot/vmlinuz ks=http://#{ipnode}/unattended/provision
ksdevice=#{mac} network kssendmac ip=#{ip} netmask=#{subnetMask}
gateway=#{subnetGateway} blacklist=lpfc" + "\n")
BOOTX.write("initrd /images/pxeboot/initrd.img
rootfstype=auto ro " +"\n\n")
Host.create(:hostgroup_id=>"#{hostgroup}", :name =>
"#{name}", :mac => "#{mac}", :ip => "#{ip}", :provision_method =>"build",
:managed => "true", :enabled => "1" )
The only remaining problem is when hosts is build , sym link is still
existing so if hosts boot again on pxe start up hang. by leak of time i
didn't try to remove it after provisioning when the pxelinux file is
removed.
so for allowing UEFI boot over tftp/ pxelinux existing server we need (
path are according to my config)
-file named with HEXA formatted ip adresse wich contains specific uefi
boot instruction
-bootx64.efi file ( copied from server's boot directory)
-splash.xpm.gz file or any equivalent if you want.
- default boot file config for uefi provisioned by template UEFI_boot.erb
as PXE linux template :
#default linux
#label linux
#kernel <%= @kernel %>
#append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%>
ksdevice=<%= @host.mac %> network kssendmac blacklist=lpfc
hope it can be helpfull…
i try by me self if i get some free time to remove ym link after build
@