Skip to content

Commit

Permalink
Refs #36834 - New PXE loader "Grub2 UEFI SecureBoot (target OS)"
Browse files Browse the repository at this point in the history
  • Loading branch information
goarsna committed Nov 22, 2023
1 parent 147d3b0 commit 41c2a8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions app/models/concerns/orchestration/dhcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def dhcp_attrs(record_mac)
dhcp_attr[:nextServer] = boot_server unless host.pxe_loader == 'None'
filename = operatingsystem.boot_filename(host)
if filename.include? "@@subdir@@"
mac = host.mac.downcase
filename = filename.gsub("@@subdir@@", mac.tr(':', '-').downcase)
filename = filename.gsub("@@subdir@@", record_mac.tr(':', '-').downcase)
end
dhcp_attr[:filename] = filename if filename.present?
if jumpstart?
Expand Down
19 changes: 10 additions & 9 deletions app/models/concerns/orchestration/tftp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,16 @@ def default_pxe_render(kind)
# Adds the host to the forward and reverse TFTP zones
# +returns+ : Boolean true on success
def setTFTP(kind)
if kind.to_s == "PXEGrub2TargetOS"
content = generate_pxe_template("PXEGrub2".to_sym)
else
content = generate_pxe_template(kind)
end
content = if isPXEGrub2TargetOS(kind)
generate_pxe_template("PXEGrub2".to_sym)
else
generate_pxe_template(kind)
end
if content
logger.info "Deploying TFTP #{kind} configuration for #{host.name}"
each_unique_feasible_tftp_proxy do |proxy|
mac_addresses_for_provisioning.each do |mac_addr|
targetos = nil
if kind.to_s == "PXEGrub2TargetOS"
targetos = host.operatingsystem.name.downcase
end
targetos = host.operatingsystem.name.downcase if isPXEGrub2TargetOS(kind)
proxy.set(kind, mac_addr, {:pxeconfig => content, :targetos => targetos})
end
end
Expand Down Expand Up @@ -212,4 +209,8 @@ def each_unique_feasible_tftp_proxy
end
results.all?
end

def isPXEGrub2TargetOS(kind)
kind.to_s == "PXEGrub2TargetOS"
end
end

0 comments on commit 41c2a8f

Please sign in to comment.