6

Is there a script or another way to automatically generate a kickstart configuration file from the system state of an existing server so that the file can be use to replicate (not clone) the configuration of the system in another install?

I know that the anaconda-ks.cfg file is stored on the /root dir. but the system in question have been extensively changed since it's installation, and the file is of no use now.

ÜMineiro
  • 63
  • 1
  • 1
  • 5

2 Answers2

4

This is one approach I know of. To my knowledge, there is no method to automatically generate a Kickstart file based on system state.

Run rpm -qa --qf '%{NAME}\n' and add to the %packages section in the Kickstart.

Nevertheless, this is not a comprehensive solution for maintaining system standards and builds. This is a more comprehensive answer I wrote on the subject:

Managing an application across multiple servers, or PXE vs cfEngine/Chef/Puppet

Warner
  • 23,440
  • 2
  • 57
  • 69
  • 2
    It's not a perfect solution, but it did the trick. I only changed it a bit, using rpm -qa --qf '[%{INSTALLTIME}\t][%{INSTALLTIME:day} \t][%-40{GROUP}\t]%{NAME}\n'|sort -t \t -k 1,3 instead, so that I ended up with a list broken by date and groups, which gave-me a better understanding of how the system evolved and allowed to simplify the package selection by putting entire groups where it made sense. Thanks – ÜMineiro Jun 18 '10 at 14:41
4

Just to add on the Warner's answer. While the rpm query will give you a list of installed packages, it won't help you construct a kickstart file that is close to your system configuration.

Red Hat provides a tool called "system-config-kickstart" which will allow you to use an Anaconda like wizard to create a kickstart file. You could use the tool to configure partitioning information, network, timezone, etc.

Adding the both togther will perhaps help you create a kickstart that is close to your original system.

katriel
  • 4,407
  • 22
  • 20
  • It can be of help, but since I do already have the original anaconda-ks.cfg, this kind of stuff is readily available. Thanks anyway. – ÜMineiro Jun 18 '10 at 13:31