LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   kickstarting a large number of nearly identical CENTOS servers (http://www.linuxquestions.org/questions/linux-server-73/kickstarting-a-large-number-of-nearly-identical-centos-servers-742031/)

slinx 07-22-2009 02:10 PM

kickstarting a large number of nearly identical CENTOS servers
 
Hi, I'm getting ready to install a large number of servers. They have identical hardware. Each server will have nearly identical software, except for some differences in configurations, such as site IPs, printer IPs, time zone, etc. I have a kickstart that works nicely, but is there a way I can have each server look up its serial number using dmidecode (I know how to do this), then match or assign its serial number to a list of site configurations on the kickstart server, and then assign itself the correct configuration, and make a list of which serial numbers go with which configuration?

So if I have a list of sites, with each configuration, server 1 to kickstart will go to the list, add its serial number to the first record in the list, and download that configuration. Then server 2 will go to the list, and find the next record lacking a serial number, add its serial number, and then download the config, and so on.

Is there an easy way to do this? The kickstart server is running Ubuntu 2.6 kernel

Thank you!

zQUEz 07-23-2009 06:58 AM

Assuming dmidecode is available during the kickstart process, I would say you can look at using the %pre section of the kickstart script to work out the serial using dmidecode, then send that information to a http server and using perl or php or other, create the dynamic variables and send back as an updated ks file that is then used to build the server.

dxangel 07-23-2009 11:08 AM

better idea ( i do this a lot! )

you can actually use the cgi-bin to generate a 'cfg file for each configuration and as long as what you want to change is in the kickstart file, you can add it to the url, ie:

Code:

http://kickstart.your.domain/cgi-bin/default.cfgx&IP=1.2.3.4
&Hostname=foo.yourdomain.com&packages=mypackagefile&&ksdevice=eth1&disk=hda

(wrapped for sane-ness)


Rather than having $lots of seperate kickstart files for each, you can have one or two and tweak the url as necessary.

Rogue45 07-27-2012 04:30 PM

Right now i just have a separate .cfg file that includes only my site specific variables. That way i can modify things like IP or timezone very quickly In %pre i parse that file out to two other ones. One for command section variables and the other for variables i need in post.

I would imagine if your script can identify its configuration then you could just have a .cfg file generated based on a database query?


All times are GMT -5. The time now is 05:32 PM.