Re: ks.cfg via http

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 2002-04-09 at 23:41, Michael Blandford wrote:
> I am trying to get my kickstart file from http.
> 
> If I get it as a flat file, ie
> 
> http://server/ks.cfg
> 
> it works fine.
> 
> However, if I try:
> 
> http://server/ks.cgi
> 
> It bombs out.
> 
> I get an error in the readkickstart function key error a67
> 
> Has anyone seen this before?  Also, should I print out a content type, 
> etc if I do this?

Yup, what you need to do is to output the headers "Content-length" (varies
with each file) and "Content-type" (always set it to "text/plain").  You'll
need to calculate the total length of the "file" you're going to output
(I generate it into a string and then call strlen on it).  For example:

Content-length: 2132
Content-type: text/plain

<insert 2132 bytes here :-)>


I just did a similar thing myself.  Using php and mysql I've created an
environment where I can create/display/edit kickstart config files.  The
entries are generated whenever a client asks for its kickstart config
file (they are dynamically generated based on the IP address).  Each
keyword that makes up the config file can be specific to the client, or it
can be a pointer to a "standard" entry.  For example, all of my installs are
in the same timezone, so each client config keyword "timezone" has a pointer
to the "Standard timezone" database entry.  If I move to a different timezone,
all I have to do is edit the "Standard timezone" database entry with the
new timezone.  On the other hand, I have many different mice installed, so
the "mouse" keyword for each of the clients is specific to that client.

Using this type of a setup has greatly eased my new installs.  When I get
a new machine in all I need to do is to go to a webpage that allows me
to add a new client, select the various options for the config file and
then do a standard kickstart.  Recently I moved where I was getting the
packages from (from one NFS directory to another) -- I only had to make
one change in the database, instead of editing each and every #*@#*#@*#
static config file -- can you tell I've done this before?  :-)

...dave





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux