I'm using iPXE to boot my servers right now and I didn't find other way to actually get the i/gPXE template with static IP from foreman without having to actually use a php script to load http://foreman/unattended/gPXE which adds the X-RHN-Provisioning-MAC-0 http header allowing the machine the access to my i/gPXE template.
This way my template sends the machine based on MAC the exact ip address configured in foreman that CentOS should kickstart from, as I'm not using DHCP for my local network.
It would worth supporting a GET request that would allow sending the mac address to /unattended/gPXE and a default response (i.e blank page) when the machine is already built in foreman instead of the http 40x errors, this way you could for eg. chainload iPXE everytime the machine boots without having to worry about it or use other pages to determine foreman's response.
#1 Updated by Ohad Levy almost 8 years ago
one thing I'm not sure I understand, why does it does it use the correct ip address upfront? (e.g. did you configure dhcp) or is that the case where dhcp is not used and you get a random ip address?
using the correct ip address, foreman would match the provisioning data.
#3 Updated by Ohad Levy almost 8 years ago
- Status changed from New to Feedback
Alexandru S. wrote:
Sorry for not mentioning that, DHCP is configured to assign ip addresses only to PXE booting machines and the smart proxy is not touching it (if that's what you mean by not used), anything else on the network needs static ip address.
the recommended approach would be to let foreman create a dhcp reservation, where the host would use that for initial boot, and later on during kickstart / puppet change it to static ip address.
if you use that way, your i/gpxe provisioning should work as expected.
#4 Updated by Alexandru S. almost 8 years ago
I don't see this as a viable option for our current setup, which includes more than 700 machines with static ip address and nfs root configured through DHCP that won't be moved to puppet/foreman yet as first of all we want to make sure that the workstations transition is done right.
Anyway, I will stick with the php script in front of iPXE, as the setup does not require another reservation which I would have to make a request for (Company's rules), for now and hopefully this will be supported in the future.
#6 Updated by Dominic Cleal about 6 years ago
- Description updated (diff)
I extended this via the foreman_bootdisk plugin to do roughly what you're asking - the URL then takes an additional mac parameter so you don't need the anaconda header.
The 40x error is another problem I've seen, but haven't fixed yet. We could do with the equivalent of the PXELinux "localboot" template for gPXE - or a pre-programmed blank response as you say.
#8 Updated by Lukas Zapletal over 1 year ago
Just for the record, the PR associated to this ticket is more of a generic and improved iPXE support in Foreman while the ticket requests support sending MAC address in unattended iPXE call. This was available for years if you had foreman bootdisk plugin enabled, in Foreman 1.17+ this code moved into core so it's possible to do this without bootdisk plugin. The parameter to send is called just "mac".