[WBEL-users] Network kickstart scripts

Joshua Weage weage98@yahoo.com
Tue, 27 Jul 2004 07:21:22 -0700 (PDT)


So much for that.  For those on the digest, here are the files inlined:

Kickstart File
<--- BEGIN HERE ---->
# RedHat Advanced Server 3

install
nfs --server 10.164.29.1 --dir /mnt/rm8000_2/netboot/redhat/3AS/orig
lang en_US
langsupport en_US
keyboard us
mouse
skipx
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$U0àwtö6N$vQ6kFx4k.uhOR9Cxm8M7A.
firewall --disabled
authconfig --enableshadow --enablemd5 --enablecache --enablenis
--nisdomain atgdetroit
timezone America/Detroit
bootloader --location=mbr

reboot

clearpart --linux
part /boot --fstype ext3 --size=256
part / --fstype ext3 --size=6124
part swap --recommended
part /var --fstype ext3 --size=1024
part /usr/local --fstype ext3 --size=1 --grow

%packages --resolvedeps
@ Everything

%post

GATEWAY=10.164.59.1
NFSSERV=10.164.29.1
BOOTDIR=/mnt/rm8000_2/netboot
NISDOMAIN=atgdetroit

#
# configure eth0 with a static IP
#
echo ""
echo "Configure eth0 static IP address"

IP=`ifconfig eth0 | grep inet | awk '{print $2}' | awk -F: '{print
$2}'`
HW=`ifconfig eth0 | grep HWaddr | awk '{print $5}'`
NM=`ifconfig eth0 | grep inet | awk '{print $4}' | awk -F: '{print
$2}'`

cd /etc/sysconfig/network-scripts

echo "DEVICE=eth0
BOOTPROTO=none
HWADDR=$HW
IPADDR=$IP
GATEWAY=$GATEWAY
NETMASK=$NM
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet" > ifcfg-eth0

cd /etc/sysconfig/networking/devices

ln /etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-eth0


#
# Mount netboot

mkdir /mnt/netboot
chmod 755 /mnt/netboot
mount -r -o nolock ${NFSSERV}:${BOOTDIR} /mnt/netboot

echo ""
echo "Configuring hostname"

HOSTNAME=`grep $IP /mnt/netboot/config/troy/hosts | awk '{print $3}'`

echo "NETWORKING=yes
HOSTNAME=$HOSTNAME" >/etc/sysconfig/network
if [ "$NISDOMAIN" != "NA" ]
then
        echo "NISDOMAIN=$NISDOMAIN" >>/etc/sysconfig/network
fi

echo ""
echo "Adding NFS disks"

mkdir /jobs
mkdir /data

chmod 755 /jobs
chmod 755 /data

echo "" >> /etc/fstab
echo "warlns1:/raid/jobs /jobs nfs
rsize=8192,wsize=8192,timeo=20,hard,intr 0 0" >> /etc/fstab
echo "warlns1:/raid/home /home nfs
rsize=8192,wsize=8192,timeo=20,hard,intr 0 0" >> /etc/fstab
echo "warlns1:/raid/data /data nfs
rsize=8192,wsize=8192,timeo=20,hard,intr 0 0" >> /etc/fstab
echo "warlns1:/mnt/rm8000_2/netboot /mnt/netboot nfs
rsize=8192,wsize=8192,timeo=20,hard,intr 0 0" >> /etc/fstab
echo "" >> /etc/fstab

echo ""
echo "Configuring desktop"

echo "DESKTOP=KDE" > /etc/sysconfig/desktop
echo "DISPLAYMANAGER=KDE" >> /etc/sysconfig/desktop

# Clean out /usr/local
rm -rf /usr/local/*

# root remote access
echo "rsh" >> /etc/securetty
echo "rlogin" >> /etc/securetty

# standard system updates
/mnt/netboot/bin/config-troy-3AS-ws
<---- END HERE ---->


config-troy-3AS-ws script
<----  BEGIN HERE ---->
#!/bin/sh
#
# config script for troy 3AS workstations
#

export PATH="/bin:/sbin:/usr/bin:/usr/sbin"

# Test for correct OS version
VERSION=`cat /etc/redhat-release`
if [ "$VERSION"  != 'Red Hat Enterprise Linux AS release 3 (Taroon)' ];
then
    echo "You have attempted to run the Red Hat Enterprise Linux AS
release 3 (Taroon)"
    echo "script on $VERSION"
    echo " "
    exit 1
fi

echo " "
echo "Copying config files"

cp /mnt/netboot/config/troy/hosts.equiv /root/.rhosts
chmod 400 /root/.rhosts
cp /mnt/netboot/config/troy/hosts.equiv /etc/hosts.equiv
chmod 644 /etc/hosts.equiv
cp /mnt/netboot/config/troy/ntp.conf /etc/ntp.conf
chmod 644 /etc/ntp.conf
cp /mnt/netboot/config/troy/hosts /etc/hosts
chmod 644 /etc/hosts
cp /mnt/netboot/config/troy/sudoers /etc/sudoers
chmod 440 /etc/sudoers

[ ! -d /root/.ssh ] && mkdir /root/.ssh
chmod 700 /root/.ssh

cp /mnt/netboot/config/common/ssh/authorized_keys /root/.ssh
cp /mnt/netboot/config/common/ssh/id_dsa /root/.ssh
cp /mnt/netboot/config/common/ssh/id_dsa.pub /root/.ssh

chmod 644 /root/.ssh/authorized_keys
chmod 600 /root/.ssh/id_dsa
chmod 644 /root/.ssh/id_dsa.pub


echo " "
echo "Configuring services"

/sbin/chkconfig --level 2345 rawdevices off
/sbin/chkconfig --level 2345 mdmonitor off
/sbin/chkconfig --level 2345 isdn off
/sbin/chkconfig --level 2345 iptables off
/sbin/chkconfig --level 2345 ip6tables off
/sbin/chkconfig --level 2345 pcmcia off
/sbin/chkconfig --level 2345 sendmail off
/sbin/chkconfig --level 2345 autofs off
/sbin/chkconfig --level 2345 rhnsd off
/sbin/chkconfig --level 2345 hpoj off
/sbin/chkconfig --level 2345 canna off
/sbin/chkconfig --level 2345 FreeWnn off

/sbin/chkconfig --level 2345 ntpd on 
/sbin/chkconfig --level 2345 vsftpd on 
/sbin/chkconfig --level 2345 rexec on 
/sbin/chkconfig --level 2345 rlogin on 
/sbin/chkconfig --level 2345 rsh on 
/sbin/chkconfig --level 2345 telnet on 

/etc/init.d/ntpd start

echo " "
echo "Configuring local disk"

[ ! -d /usr/local/etc ] && mkdir /usr/local/etc
[ ! -d /usr/local/tmp ] && mkdir /usr/local/tmp
chmod 777 /usr/local/tmp

cp /mnt/netboot/config/common/cshrc /usr/local/etc/cshrc
chmod 644 /usr/local/etc/cshrc

echo " "
echo "Installing local software"

for file in /mnt/netboot/local-rpms/common/*; do
  rpm -Uvh --nodeps $file
done

for file in /mnt/netboot/local-rpms/common-3AS/*; do
  rpm -Uvh --nodeps $file
done

for file in /mnt/netboot/local-rpms/common-troy/*; do
  rpm -Uvh --nodeps $file
done

for file in /mnt/netboot/local-rpms/workstation/*; do
  rpm -Uvh --nodeps $file
done

for file in /mnt/netboot/local-rpms/workstation-3AS/*; do
  rpm -Uvh --nodeps $file
done

echo " "
echo "Configuring local software"

#cp /mnt/netboot/config/pes/server_name /var/spool/pbs/server_name
#chmod 644 /var/spool/pbs/server_name

# /usr/sbin/makewhatis

echo ""
echo "Done"
<---- END HERE ---->



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail