[debian-lan-devel] [PATCH] Reserved leases for member client machines

Afif Elghraoui afif at debian.org
Mon Sep 5 08:51:31 UTC 2016


Hello,

One of the changes to the current debian-lan-config that I thought would
make things easier as I'm working on the config-package system was to
avoid directly specifying the IP addresses that client machines are to
use, leaving it instead to the DHCP server to figure out. The attached
patch (also viewable at
<https://anonscm.debian.org/git/users/afif/debian-lan-config.git/commit/?h=topic/node-setup&id=af1ad30fe0db4f6283d2fbae498c146342075af2>)
uses reserved addresses instead. It also tracks the machines in separate
files that are included by /etc/dhcp/dhcpd.conf.


With this patch, the following happens when a host is added with
debian-lan add2dhcp:

* The hostname is added to /usr/local/etc/hosts
  - This file is used to determine the host number (workstationXX) by
incrementing the highest number of the existing hostname of the same
class in that list. This file can also be used as the hosts file for a
network-wide ssh tool like pssh (which I also configured in a separate
commit).

* The DHCP host entry is added to /etc/dhcp/clients.d/<class>.list

When the machine boots and IP address is first assigned, a DHCP commit
hook I've added copies the appropriate PXE template using a wrapper
command on fai-chboot.


There are some improvements that could be made, especially with the
duplication of the execute statement for workstation and diskless, but
I'm not well-versed enough with the dhcpd configuration language to fix
that currently.


Many thanks and regards
Afif


-- 
Afif Elghraoui | عفيف الغراوي
http://afif.ghraoui.name
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-More-flexible-mechanism-for-adding-hosts.patch
Type: text/x-diff
Size: 10787 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-lan-devel/attachments/20160905/8afe43e6/attachment.patch>


More information about the debian-lan-devel mailing list