Passing parameters in http url?

Jason Kohles email at jasonkohles.com
Mon Sep 20 18:33:21 UTC 2004


On Mon, Sep 20, 2004 at 08:52:36PM +0300, Kimmo Koivisto wrote:
> 
> So, is it possible to define "query" parameters to the kickstart http url 
> during the boot? 
> 
> Example:
> ks=http://kickstart.server.domain/kickstart.php?hostname=newmachine.domain.test&startssh=1&type=ldapserver
>  
Yes, although I have found that sometimes kickstart chokes on the ? and
& in the url (this may have been fixed though).  In the past I worked
around that just by using PATH_INFO instead of a query, so your url
would be like
http://server/ks.cgi/hostname=newmachine.domain/startssh=1/type=ldapserver

Then your ks.cgi can be something as simple as (I don't do php):

#!/usr/bin/perl -w
use strict; use warnings;
use CGI;
my $cgi = new CGI;
my @vars = split('/',$cgi->path_info); my %vars;
for(@vars) { my($l,$r) = split('=',$_); $vars{$l} = $r; }

print $cgi->header,<<"END";
# Generated kickstart file for $vars{hostname}

... kickstart configuration ...

%post
END

print "chkconfig sshd ".($vars{startssh} ? 'on' : 'off')."\n";

-- 
Jason Kohles                         A witty saying proves nothing.
email at jasonkohles.com                   -- Voltaire (1694 - 1778)
http://www.jasonkohles.com/





More information about the Kickstart-list mailing list