Bug 1168724 - cobbler - split out dhcp_cobbler.conf config file
cobbler - split out dhcp_cobbler.conf config file
Status: IN_PROGRESS
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Christian Vögl
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-06 12:07 UTC by Thomas Renninger
Modified: 2020-04-09 13:22 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Renninger 2020-04-06 12:07:57 UTC
Backing up and deploying dhcp.conf via cobbler is ugly as one half of the file static network specification and the other half is cobbler generated.

It would be great to have this split up.

I'd suggest to do it similar like orthos does.
Unfortunately even latest dhcp server package seem not to have /etc/dhcpd.d/ subdirectory?

But it should still be possible to try to create this (without throwing error when it already exists) and add it in cobbler files section.

There could be 2 files then provided by cobbler and which have to be added to the  main, static, untouched /etc/dhcpd.conf file:
/etc/dhcpd.d/cobbler_generated.conf
/etc/dhcpd.d/cobbler_arch.conf


/etc/dhcpd.d/cobbler_generated.conf
could be like:
# ******************************************************************
# 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.
#
# ******************************************************************

#import netaddr


#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 {
...
#end for



/etc/dhcpd.d/cobbler_arch.conf:
     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

          # Legacy
          if option system-arch = 00:00 {
              filename "grub/grub.0";
          }
          # UEFI-32-1
...


/etc/dhcpd.conf
should not be written at all, this has to be touched by the admin anyway.
No need to take over this line:
     next-server                $next_server;

It should be documented that the admin has to add:
include "/etc/dhcpd.d/cobbler_arch.conf";
include "/etc/dhcpd.d/cobbler_generated.conf;