Kickstart script with parameters.

Kenneth Holter kenneho.ndu at gmail.com
Wed Aug 26 13:09:12 UTC 2009


Another approach would be to something like this:

   1. Create a parameter that you pass to anaconda (i.e. add to the command
   line after the "ks=..." parameter). Example: "ks=.... servertype=database"
   2. In the pre-script, before you partition the disk, do something like
   this:
      1. read the value of the servertype-parameter
      2. If the value is "database", fetch (using for example wget) a file
      containing the database partition scheme. This means that you
have to have
      one file per partitioning scheme. If the value is
"applicationserver" then
      fetch the application server disk partition file.
      3. Run partition based on this file

I havent' implemented this myself, so I'm not into the details, but the
general approach should work.
On 8/26/09, Berthold Cogel <cogel at uni-koeln.de> wrote:

> Rohit khaladkar schrieb:
> > Hi All,I need to know if the kickstart script used for Redhat Linux
> > installation can work with customised parameters ?
> > I have two servers :
> > 1)Application server  : With less disk space
> > 2)Database server. : With more disk space.
> >
> > The partitioning would vary on the type of the server. I was wondering if
> I
> > can use the "user supplied parameters" in the kickstart script so that
> > partitioning can change according to the parameter supplied.
> >
> > Please let me know if there would be any other approach to handle this
> > situtation
> >
>
>
> We are using a HTTP based installation server with a CGI that generates
> customized kickstart scripts. Parameters are passed via PATH_INFO to the
> CGI:
>
> ks=http://<installserver>/cgi-bin/ks.cgi/EL/5/i386/server/ks.cfg
>
> This defines the distribution (we use sometimes Centos), the OS version,
> architecture and the version (Workstation or Server)... This is needed
> for the url parameter in the header of the script. And for some defaults
> in %pre ans %post sections.
>
> Additional parameters can then be passed as kernel parameters on the
> commandline:
>
> linux install ks=... <NAME>=<VALUE>
>
> Then you must parse /proc/cmdline in the %pre and %post section of your
> kickstart script:
>
> if grep -i -q "NAME=[a-z0-9]" /proc/cmdline
> then
>    NAME=`cat /proc/cmdline | sed 's/.*NAME=\([^ ]*\).*/\1/'`
> fi
>
>
> Now you can generate includes for your kickstart script from this. Or
> you can load predefined includes via wget in the installation system
> during the process. We have a library of scripts that are included this
> way in %pre and %post sections. What you get is something like this:
>
>
> # Kickstart configuration file EL 3 kickstart Mode
>
> #  EL 3 i386 WS
> # Linux:    EL
> # Version:  3
> # Modus:    kickstart
> # Variante: WS
>
> # parameter for installation
> text
> install
> url --url http://<installserver>/rhel/EL-3/current/i386/WS
> lang de_DE
> keyboard de-latin1-nodeadkeys
>
> mouse
>
> # generated includes
> %include /tmp/language.inc
> %include /tmp/global.inc
> %include /tmp/network.inc
> %include /tmp/diskconf.inc
>
> %packages --resolvedeps --ignoremissing
> %include /tmp/packages.inc
> %include /tmp/packages-exclude.inc
>
>
> #############
> #
> # Pre Section
> #
> #############
>
> %pre
>
> #!/bin/sh -x
> #
> # Pre-Install
> #
>
> LINUX=EL
> LINUX_VERSION=3
> FLAVOR=WS
> ARCH=i386
>
> ...
>
>
>
> Regards,
> Berthold Cogel
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>



More information about the redhat-list mailing list