Smart tftp server...

Douglas Kilpatrick kilpatds at oppositelock.org
Thu May 27 15:33:58 UTC 2010


Scott Henson wrote:
> This sounds fantastic.  It would be nice if it could understand
> distros/images and systems.  In that case we could eliminate sync for
> most things (dhcp and dns would still need it, but those are
> optional).  Do you think this would be possible?

It should be...

One preference would be to try and prevent hardcoding logic into the 
tftp.py server.  I'd like the server to basically implement the 
following logic:

   Get request for file X from client
   Lookup the system in cobbler by ip_address
   Use system_item to map virtual file X to template Y
   Expand template Y, and return that
   Fallback to /tftpboot if there is no translation entry for file X

Template Files seems to express the following
   Given template X, generate file Y

because it expands path Y based off of variables.  The expression I want 
is closer to "Given virtual file Y, generate it from template X"

Because if I can expand the template path, then it becomes very easy to 
have default values that handle the kernel/initrd

   cobbler_kernel: '$kernel'
   cobbler_initrd: '$initrd'

and use those names in the generated pxelinux.cfg

(Yes, I'll need some `file` magic to not expand binary files)

So should I add another attribute for that purpose?  Or continue trying 
to use template_files?

Doug
-- 
Doug Kilpatrick
kilpatds at oppositelock.org


More information about the cobbler-devel mailing list