Project

General

Profile

Actions

Bug #26448

closed

Unable to give host (unmanaged) DHCP address with bootdisk and preseed templates

Added by Damon Maria about 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

First my situation: I am provisioning hosts deep within a client's network, where I have no control over the network. So I'm trying to use a bootdisk ISO and the host needs to get it's network info from the client's (unmanaged) DHCP server.

I've only been able to get this working by making changes to the default templates.

Most problematic was "Preseed default iPXE". It has the following:

<% static = @host.token.nil? ? '?static=yes' : '&static=yes' -%>

kernel <%= kernel %> initrd=initrd.img interface=auto url=<%= foreman_url('provision')%><%= static %> ramdisk_size=10800 root=/dev/rd/0 rw auto netcfg/disable_dhcp=true BOOTIF=01-${netX/mac:hexhyp} hostname=<%= @host.name %> <%= keyboard_params %> locale=<%= host_param('lang') || 'en_US' %> netcfg/get_ipaddress=${netX/ip} netcfg/get_netmask=${netX/netmask} netcfg/get_gateway=${netX/gateway} netcfg/get_nameservers=${dns} netcfg/confirm_static=true

Which is all hard coded for static addresses (even overriding with that when fetching the provisioning template). To get it to work with DHCP I had to clone it and strip out anything relating to static addresses. I ended up using:

kernel <%= kernel %> initrd=initrd.img interface=auto url=<%= foreman_url('provision')%> ramdisk_size=10800 root=/dev/rd/0 rw auto BOOTIF=01-${netX/mac:hexhyp} hostname=<%= @host.name %> <%= keyboard_params %> locale=<%= host_param('lang') || 'en_US' %>

Another lessor problem, but still a bug I think, is the "preseed_networking_setup" snippet. It contains 4 instances of checks like the following:

<% host_dhcp = host_subnet.nil? ? false : host_subnet.dhcp_boot_mode? -%>

Shouldn't if there is no subnet defined it use DHCP? i.e. false should be true? At the moment I have to define a subnet on my interface to get DHCP to work which seems wrong. And with the current logic after determining that host_subnet is nil it then tries to access properties on host_subnet.

Actions #2

Updated by Damon Maria over 4 years ago

  • Status changed from New to Resolved

Fixed in 1.23

Actions

Also available in: Atom PDF