Hi
'cobbler sync' should regenerate dhcp/tftp configs, if you have them
enabled in /etc/cobbler/settings:
# set to 1 to enable Cobbler's DHCP management features.
# the choice of DHCP management engine is in /etc/cobbler/modules.conf
manage_dhcp: 1
# set to 1 to enable Cobbler's TFTP management features.
# the choice of TFTP mangement engine is in /etc/cobbler/modules.conf
manage_tftpd: 1
your dhcp config uses the dhcp.template in /etc/cobbler. Adapt this to
your needs. Here is our one that copes with all the different subnets. I
seem to remember I had to tweak this, but don't remember the exact
details!
# ******************************************************************
# Cobbler managed dhcpd.conf file
#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
#
# ******************************************************************
#
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 10.128.17.0 netmask 255.255.255.0 {
option routers 10.128.17.1;
option domain-name-servers 10.96.16.111,10.128.24.12,10.96.16.112;
option subnet-mask 255.255.255.0;
## range dynamic-bootp 10.128.17.2 10.128.17.254;
range dynamic-bootp 10.128.17.9 10.128.17.9;
default-lease-time 21600;
max-lease-time 43200;
## next-server $next_server;
next-server 10.128.17.122;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) =
"PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
}
#for dhcp_tag in $dhcp_tags.keys():
## group could be subnet if your dhcp tags line up with your subnets
## or really any valid dhcpd.conf construct ... if you only use the
## default dhcp tag in cobbler, the group block can be deleted for a
## flat configuration
# group for Cobbler DHCP tag: $dhcp_tag
group {
#for mac in $dhcp_tags[$dhcp_tag].keys():
#set iface = $dhcp_tags[$dhcp_tag][$mac]
host $iface.name {
hardware ethernet $mac;
#if $iface.ip_address:
fixed-address $iface.ip_address;
#end if
#if $iface.hostname:
option host-name "$iface.hostname";
#end if
#if $iface.netmask:
option subnet-mask $iface.netmask;
#end if
#if $iface.gateway:
option routers $iface.gateway;
#end if
#if $iface.enable_gpxe:
if exists user-class and option user-class = "gPXE" {
filename
"http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else if exists user-class and option user-class = "iPXE" {
filename
"http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else {
filename "undionly.kpxe";
}
#else
filename "$iface.filename";
#end if
## Cobbler defaults to $next_server, but some users
## may like to use $iface.system.server for proxied setups
## next-server $next_server;
next-server $iface.next_server;
}
#end for
}
#end for
You can use 'cobbler system getks --name=foo' to see the kickstart that
will be generate. You can use 'cobbler system dumpvars --name=foo' to
dump all the variables for a system. for example http_server and
next_server are normally the same thing.
Alastair
On 2016-05-02 17:44, Tory M Blue wrote:
On Sun, May 1, 2016 at 7:48 PM, bishop <bis...@platypus.bc.ca> wrote:
Tory (and everyone else):
I think this is the code you want to mod, if my python's not
laughable:
/usr/lib/python2.4/site-packages/cobbler/pxegen.py
214: try:
215: ipaddress =
socket.gethostbyname_ex(blended["http_server"])[2][0]
216: except socket.gaierror:
217: ipaddress = blended["http_server"]
218: kickstart_path = "http://%s/cblr/svc/op/ks/system/%s"
%
(ipaddress, system.name)
I say cut that out or mod it, and the string will be preserved. Fix
the DNS
to match, and you're golden.
Thanks will take a look. I think the big deal is how to get the
Next-server from the dhcp server. Cobbler and dhcp don't seem to talk
to each other :) So the initial pxe boot, has next-server, which the
server users to grab it's kernel files, and then there is another dhcp
call, which is ultimately used to call the ks file. We really need to
be able to capture the next-server variable between dhcp and cobbler,
but I'm not versed enough to see how that would be made possible.
I'm wondering if we don't use next-server (since both cobbler and dhcp
use it) and we create a different variable inside the dhcp stanza,
would that would allow us to grab it from cobbler (the above code).
Thanks again Bishop
Tory
_______________________________________________
cobbler mailing list
cobbler@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/cobbler@lists.fedorahosted.org
_______________________________________________
cobbler mailing list
cobbler@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/cobbler@lists.fedorahosted.org