I'm very close to getting Foreman working for unattended installations, but
have a hit a bit of a roadblock. I want the VM to grab a DHCP lease for the
install and then assign a static IP for when the VM boots up
post-kickstart.
Due the nature of our setup I can't have Foreman manage our DHCP server, so
instead I was able to get the gPXE boot file name manually added to our
Windows DHCP server. So now gPXE boots up and tries to grab:
which immediately returns a 404. I assume this is because the IP of the VM
isn't what Foreman expects, as the DHCP lease wasn't managed by Foreman. If
you edit the Host IP in Foreman to the one that our DHCP server allocated,
then the /unattended/gPXE page loads fine. Is there any way around this?
Are you using UUID certificates (UUID=true in Settings)? If so, I have
an experimental patch that uses the certname instead of the IP for
gettng the templates. You're welcome to try it out and give feedback -
You'll need to alter you script to wget 'unattended/gPXE?token=<%= @host.certname %>' as I've not yet modified the foreman_url function to
do that automatically.
If you're not using UUID=true then you'll have to wait until I figure
out why @host.certname returns nil for older-style hosts (it's supposed
to return the fqdn). Might try and look at that tonight…
Hope that helps,
Greg
OpenPGP -> KeyID: CA0AEB93
···
On Fri 13 Jul 2012 13:42:34 BST, Andy Taylor wrote:
> Hi,
>
> I'm very close to getting Foreman working for unattended
> installations, but have a hit a bit of a roadblock. I want the VM to
> grab a DHCP lease for the install and then assign a static IP for when
> the VM boots up post-kickstart.
>
> Due the nature of our setup I can't have Foreman manage our DHCP
> server, so instead I was able to get the gPXE boot file name manually
> added to our Windows DHCP server. So now gPXE boots up and tries to grab:
>
> http://foreman/unattended/gPXE
>
> which immediately returns a 404. I assume this is because the IP of
> the VM isn't what Foreman expects, as the DHCP lease wasn't managed by
> Foreman. If you edit the Host IP in Foreman to the one that our DHCP
> server allocated, then the /unattended/gPXE page loads fine. Is there
> any way around this?
>
> Thanks,
>
> Andy
Thanks Greg I have played around with your patch, and thought it would
be the solution. However… I don't see how this would work:
unattended/gPXE?token=<%=@host.certname %>'
with my setup. Basically the Windows server recognises gPXE clients and
sends them the foreman/unattended/gPXE URL. I configured that by following
these steps:
So there's no way of autopopulating host.certname in that request, as its
just the Windows server sending a dumb link. Unless there is some alternate
way of doing this…
Cheers,
Andy
···
On Friday, July 13, 2012 4:22:55 PM UTC+1, Greg Sutcliffe wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri 13 Jul 2012 13:42:34 BST, Andy Taylor wrote:
> > Hi,
> >
> > I'm very close to getting Foreman working for unattended
> > installations, but have a hit a bit of a roadblock. I want the VM to
> > grab a DHCP lease for the install and then assign a static IP for when
> > the VM boots up post-kickstart.
> >
> > Due the nature of our setup I can't have Foreman manage our DHCP
> > server, so instead I was able to get the gPXE boot file name manually
> > added to our Windows DHCP server. So now gPXE boots up and tries to
> grab:
> >
> > http://foreman/unattended/gPXE
> >
> > which immediately returns a 404. I assume this is because the IP of
> > the VM isn't what Foreman expects, as the DHCP lease wasn't managed by
> > Foreman. If you edit the Host IP in Foreman to the one that our DHCP
> > server allocated, then the /unattended/gPXE page loads fine. Is there
> > any way around this?
> >
> > Thanks,
> >
> > Andy
>
> Are you using UUID certificates (UUID=true in Settings)? If so, I have
> an experimental patch that uses the certname instead of the IP for
> gettng the templates. You're welcome to try it out and give feedback -
> https://github.com/theforeman/foreman/pull/102
>
> You'll need to alter you script to wget 'unattended/gPXE?token=<%=
> @host.certname %>' as I've not yet modified the foreman_url function to
> do that automatically.
>
> If you're not using UUID=true then you'll have to wait until I figure
> out why @host.certname returns nil for older-style hosts (it's supposed
> to return the fqdn). Might try and look at that tonight...
>
> Hope that helps,
> Greg
> - -------
> OpenPGP -> KeyID: CA0AEB93
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.19 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlAAPU4ACgkQ8O7RN8oK65MCuACeIS6v+mg/Dx+pxKHGVYMKYEDs
> GuQAnicr8PIaot7K74tNNbAT9K+nqul+
> =vap9
> -----END PGP SIGNATURE-----
>
>
Ah right, so it's not ever referring to the Foreman server for the
boot url (like the TFTP/PXE method would)? That's going to be tricker
then, since we can't embed anything in the headers either.
Is there any way to get the Windows server to return a slightly more
custom URL? Or perhaps the Windows server could return a URL which
points to a tiny webapp that then can reply with the correct data?
Greg
···
On 13/07/12 17:04, Andy Taylor wrote:
> Thanks Greg :) I have played around with your patch, and thought
> it would be the solution. However... I don't see how this would
> work:
>
> unattended/gPXE?token=<%=@host.certname %>'
>
> with my setup. Basically the Windows server recognises gPXE clients
> and sends them the foreman/unattended/gPXE URL. I configured that
> by following these steps:
>
> http://etherboot.org/wiki/pxechaining#using_pxelinux_menuc32_and_dnsmasq_to_chainload_gpxe
>
> So there's no way of autopopulating host.certname in that request,
> as its just the Windows server sending a dumb link. Unless there is
> some alternate way of doing this...
>
> Cheers,
>
> Andy
> Hi,
>
> (I know i'm responding to an ancient discussion)
>
> Have a look at this howto
> http://howto.basjes.nl/linux/doing-pxe-without-dhcp-control
> I think this dnsmasq feature (be a dhcpProxy) is the key part can be used
> to solve this scenario.
>
Its actually a one liner configuration directive to tell isc to answer only
to known hosts, that means, that only hosts that were added via foreman in
the first place would get a dhcp response.
it might be (in some cases) every a default option that unknown clients do
not get a lease.
Ohad
···
On Sun, Aug 25, 2013 at 11:34 AM, Niels Basjes wrote:
Yes, but then you will have created a probable conflict with the DHCP you
do not control because your DHCP will be handing out an IP address that the
corporate DHCP will hand out aswell to a most likely different host.
···
On Sunday, August 25, 2013 12:51:43 PM UTC+2, ohad wrote:
>
>
>
>
> On Sun, Aug 25, 2013 at 11:34 AM, Niels Basjes <ni...@basj.es > > wrote:
>
>> Hi,
>>
>> (I know i'm responding to an ancient discussion)
>>
>> Have a look at this howto
>> http://howto.basjes.nl/linux/doing-pxe-without-dhcp-control
>> I think this dnsmasq feature (be a dhcpProxy) is the key part can be used
>> to solve this scenario.
>>
>
> Its actually a one liner configuration directive to tell isc to answer
> only to known hosts, that means, that only hosts that were added via
> foreman in the first place would get a dhcp response.
>
> it might be (in some cases) every a default option that unknown clients do
> not get a lease.
>
> Ohad
>
>>
>> Niels Basjes
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Foreman users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to foreman-user...@googlegroups.com .
>> To post to this group, send email to forema...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/foreman-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>