A few people asked to see a kickstart install, so I'll post them here. I
know this is more system administration, but it is generally useful.

This is the kickstart file. You put it on your boot floppy and call it
ks.cfg. Then at the lilo prompt type linux ks=floppy. And you walk away
and have a coffee. The last server I build took 6 minutes.

You usually have to erase the *.msg files on the boot disk to make room
for the kickstart configuration file.

If you want to have the boot floppy go immediately into the install then
change the syslinux.cfg to read:

default ks
label ks
    prompt 0
    kernel vmlinuz
    append ks initrd=initrd.img

Then you just stick in the floppy and walk away.

There is also a good KickStart-HOWTO at one of the many LDP sites. Tells
you how to make your own custom install. I just keep everything here on
our network and just FTP anything else I need from our repository machine
on the network. Whatever floats your boat!

This file works great for 5.2, but the rpm install in the %post section
of the kickstart doesn't seem to want to work in 6.0. I've asked some @
Redhat about it so we'll see. The source for the install doesn't seem to
be on any of the redhat FTP sites so I can't tell what's wrong (the source
wasn't anywhere I could find it anyway.). I'm sure it will work by the
time Redhat is selling CDs, which will be in a couple of days.

If anyone has anymore kickstart questions, feel free to drop me a line.
It's saved me billions of hours. And it's a great way to have a set of
consistent machines.

jason.

# -----------------------------------------------------------------------------
# L A N G U A G E   S P E C I F I C A T I O N (Required for upgrade)
# -----------------------------------------------------------------------------

lang en

# -----------------------------------------------------------------------------
# N E T W O R K   C O N F I G U R A T I O N
# -----------------------------------------------------------------------------

network --bootproto dhcp

# -----------------------------------------------------------------------------
# I N S T A L L A T I O N   M E T H O D (Required for upgrade)
# -----------------------------------------------------------------------------

nfs --server 10.10.1.3 --dir /repository/redhat5.2

# -----------------------------------------------------------------------------
# K E Y M A P   S P E C I F I C A T I O N (Required for upgrade)
# -----------------------------------------------------------------------------
 
keyboard us

# -----------------------------------------------------------------------------
# P A R T I T I O N   S P E C I F I C A T I O N
# -----------------------------------------------------------------------------
zerombr yes
clearpart           --all
part /              --size  500
part swap           --size  128
part /www           --size 2000
part /tmp           --size  200

# -----------------------------------------------------------------------------
# I N S T A L L / U P G R A D E   S P E C I F I C A T I O N (Required for upgrade)
# -----------------------------------------------------------------------------
 
install

# -----------------------------------------------------------------------------
# R O D E N T   S P E C I F I A T I O N
# -----------------------------------------------------------------------------

mouse --kickstart --noprobe none

# -----------------------------------------------------------------------------
# T I M E Z O N E   S P E C I F I C A T I O N
# -----------------------------------------------------------------------------

timezone --utc US/Eastern

# -----------------------------------------------------------------------------
# R O O T   P A S S W O R D
# -----------------------------------------------------------------------------
#
rootpw youthinkso
#
# -----------------------------------------------------------------------------
# A U T H E N T I C A T I O N  C O N F I G U R A T I O N
# -----------------------------------------------------------------------------

#auth # This is for 6.0 only

# -----------------------------------------------------------------------------
# L I L O   C O N F I G U R A T I O N (Required for upgrade)
# -----------------------------------------------------------------------------

lilo --location mbr

# -----------------------------------------------------------------------------
# P A C K A G E   S P E C I F I C A T I O N
# -----------------------------------------------------------------------------
#
# For a server we want some base packages. We take as much stock
# RedHat as we can, but if we need newer versions of packages, or
# we need packages that aren't GPL'd then we'll install those
# later via ftp.

%packages
@ Network Management Workstation
@ C Development
@ C++ Development
cvs
bzip2
dhcp
dhcpcd
expect
howto
jed
lynx
mc
mgetty
mkisofs
nfs-server
rsync
samba
tcl
tk
wu-ftpd
xntp3

# -----------------------------------------------------------------------------
# P O S T - I N S T A L L A T I O N   C O M M A N D S
# -----------------------------------------------------------------------------

%post

mkdir /cdrom
mkdir /floppy
makewhatis
updatedb

rpm -e sendmail --nodeps
rpm -e bind-utils --nodeps
/usr/sbin/useradd -d / -s /bin/false named

LOGFILE="/tmp/install.log 2>&1"

PACKAGES="SSLeay            \
          arkeia-client     \
          arkeia-server     \
          arkeia-gui        \
          apcupsd           \
          apache-mod_ssl    \
          analog            \
          bind-chroot       \
          bind-chroot-utils \
          cdrecord          \
          cyrus-imapd       \
          mon               \
          smtpclient        \
          sniffit           \
          ssh               \
          qmail             \
          tripwire          \
          xinetd"

for package in $PACKAGES
do

    echo "-----------"                          >> /tmp/install.log 2>&1
    echo "Installing $package ..."              >> /tmp/install.log 2>&1
    rpm -i ftp://10.10.1.3/rpms/$package.rpm    >> /tmp/install.log 2>&1
    echo "Done installing $package"             >> /tmp/install.log 2>&1
    echo                                        >> /tmp/install.log 2>&1

done

DORMANT_SERVICES="arkeia    \
                  dhcpd     \
                  gpm       \
                  inet      \
                  lpd       \
                  named     \
                  nfs       \
                  pcmcia    \
                  qmail     \
                  smb"

for service in $DORMANT_SERVICES
do
    /sbin/chkconfig --del $service
done

ACTIVE_SERVICES="httpd      \
                 sshd       \
                 xinetd     \
                 xntpd"
                          
for service in $ACTIVE_SERVICES
do
    /sbin/chkconfig --add $service
done

# These are the time servers out on the net. This is
# where xntpd looks for hosts to use as timeservers.

echo "gw.compusense.com"    >> /etc/ntp/step-tickers
echo "tock.usno.navy.mil"   >> /etc/ntp/step-tickers
echo "clock.llnl.gov"       >> /etc/ntp/step-tickers
echo    "norad.arc.nasa.gov"   >> /etc/ntp/step-tickers

# We'll have to fix the rpm. I'm not sure why
# chkconfig isn't making xntpd startup on boot.
# We will just make it startup on the standard
# run levels.

/sbin/chkconfig --level 3 xntpd on
/sbin/chkconfig --level 4 xntpd on
/sbin/chkconfig --level 5 xntpd on

# This should fix the stupid thing that redhat installer
# is doing. It keeps giving me bootp and not dhcp. I ask
# for dhcp and it gives me bootp what za hell. We'll just
# put in the proper network scripts.

cat <<EOF > /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4=false
EOF

cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
EOF

# Now we want to run initialize the tripwire database
# so we get a clean snapshot of what our system is
# at install time.

(

PWD=`pwd`
cd /security/tripwire
./tripwire -c /security/tripwire/tw.config -initialize >> /tmp/install.log 2>&1
cd $PWD

# We need the proper hostname so that we can correctly name the
# database the tripwire just created. When the OS is layed down
# the first time the machine has no host name so we'll have to
# help it out. If the bootproto dhcp worked maybe I wouldn't
# have to do this. Oh well.

mv ./databases/tw.db* ./databases/tw.db_www

)


Reply via email to