[CentOS-devel] Kickstart for Automated distro testing for CentOS

Thu Apr 8 10:12:39 UTC 2010
Baptiste AGASSE <baptiste.agasse at lyra-network.com>

Hi all,

I have read that you search for some kickstart in order to test CentOS deployments.

I send you one like we use in our environment.
We use it for Xen Dom0 cluster connected to ISCSI SAN.

I hope this helps.

Regards.

##############################################################################
#                                                                            #
# Kickstart file for LAN cluster node.                                       #
#                                                                            #
##############################################################################

#
# Install type
###############################################################################

install
cdrom
text
firstboot --disabled
reboot

#
# Locale, timezone and keymap
###############################################################################

lang fr_FR.UTF-8
keyboard fr-latin9
timezone --utc Europe/Paris


#
# Network configuration
###############################################################################

### Bond1
# Admin and VMs network interface available on "public" cluster network (bonding)
network --device eth0 --onboot yes --bootproto static --ip 192.168.2.99 --netmask 255.255.255.240 --gateway 192.168.2.106 --nameserver 192.168.1.10 --hostname sirislanxen1.exemple.com
network --device eth5 --onboot yes --bootproto static --ip 192.168.2.99 --netmask 255.255.255.240 --gateway 192.168.2.106 --nameserver 192.168.1.10 --hostname sirislanxen1.exemple.com
### End Bond1


### ISCSI
# SAN interfaces
network --device eth1 --onboot yes --bootproto static --ip 10.1.1.51 --mtu 9000 --netmask 255.255.255.0 --hostname node1.exemple.com
network --device eth2 --onboot yes --bootproto static --ip 10.1.1.52 --mtu 9000 --netmask 255.255.255.0 --hostname node1.exemple.com
### End ISCSI


### Bond0
# Cluster management interfaces (bonding)
network --device eth3 --onboot yes --bootproto static --ip 10.1.0.2 --netmask 255.255.255.0 --hostname node1.exemple.com
network --device eth4 --onboot yes --bootproto static --ip 10.1.0.2 --netmask 255.255.255.0 --hostname node1.exemple.com
### End bond0


#
# Firewall, SELinux, services and security configuration
###############################################################################

# default root password : 'foo11bar'
rootpw --iscrypted $1$L.LWW5FI$kGSjEOyma9dWQA0NV/9aK1


firewall --disabled
services --disabled cups,iptables,ip6tables,kudzu,netfs,xendomains,avahi-daemon,acpid
services --enabled multipathd
authconfig --enableshadow --enablemd5
selinux --permissive

#
# Disk and partition configuration
###############################################################################

bootloader --location=mbr --driveorder=sda
clearpart --all
part /boot --fstype ext3 --size=100
part pv.5 --size=100 --grow
volgroup VolGroupXen1 --pesize=32768 pv.5
logvol / --fstype ext3 --name=LogVolRoot --vgname=VolGroupXen1 --size=6000
logvol /var --fstype ext3 --name=LogVolVar --vgname=VolGroupXen1 --size=2048
logvol swap --fstype swap --name=LogVolSwap --vgname=VolGroupXen1 --size=2048
logvol /tmp --fstype ext3 --name=LogVolTmp --vgname=VolGroupXen1 --size=2048


#
# Common packages for all cluster nodes
###############################################################################

%packages

@editors
@text-internet
@virtualization
@core
@base
@network-server
@clustering
@french-support
iscsi-initiator-utils
bridge-utils
device-mapper-multipath
vnc-server
OpenIPMI
OpenIPMI-tools
#yum-allowdowngrade
#yum-priorities
yum-security
ntp
luci
-cadaver
-gnome-applet-vm
-words
-coolkey
-nano
-autofs
-pcmciautils
-mtools
-NetworkManager
-nfs-utils
-mkbootdisk
-irda-utils
-amtu
-ypbind
-smartmontools
-ccid
-anacron
-bluez-utils
-talk
-system-config-cluster
-ipvsadm
-piranha
-firstboot-tui
-firstboot


#
# Post install script
###############################################################################

%post
#
# Bonding configuration
#

### Modprobe
# Modify the modprobe.conf file
echo "alias bnx2i off" >> /etc/modprobe.conf
echo "alias bond0 bonding" >> /etc/modprobe.conf
echo "alias bond1 bonding" >> /etc/modprobe.conf
echo "options bond0 miimon=80 mode=1 primary=eth4" >> /etc/modprobe.conf
echo "options bond1 miimon=80 mode=1 primary=eth0" >> /etc/modprobe.conf
### End Modprobe

### Bond0
# Create network interface config file for bond0
echo -e DEVICE=bond0\\nIPADDR=10.1.0.2\\nNETMASK=255.255.255.0\\nONBOOT=yes\\nBOOTPROTO=static\\nUSERCTL=no > /etc/sysconfig/network-scripts/ifcfg-bond0
### End Bond0

### Bond1
# Create network interface config file for bond1
echo -e DEVICE=bond1\\nIPADDR=192.168.2.99\\nNETMASK=255.255.255.240\\nONBOOT=yes\\nBOOTPROTO=static\\nUSERCTL=no > /etc/sysconfig/network-scripts/ifcfg-bond1
### End Bond1

### MTU
# Add MTU configuration for ISCSI
echo "MTU=9000" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "MTU=9000" >> /etc/sysconfig/network-scripts/ifcfg-eth2
### End MTU

### Bond0 IFACEs
# Modifiy slaves network interfaces config files for bond0 (eth3, eth4)
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth3
echo -e SLAVE=yes\\nMASTER=bond0 >> /etc/sysconfig/network-scripts/ifcfg-eth3
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth4
echo -e SLAVE=yes\\nMASTER=bond0 >> /etc/sysconfig/network-scripts/ifcfg-eth4
### End Bond0 IFACEs

### Bond1 IFACEs
# Modifiy slaves network interfaces config files for bond1 (eth0, eth5)
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth0
echo -e SLAVE=yes\\nMASTER=bond1 >> /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth5
echo -e SLAVE=yes\\nMASTER=bond1 >> /etc/sysconfig/network-scripts/ifcfg-eth5
### End Bond1 IFACEs

#
# VLAN configuration for VMs
#

#### VLAN 12
echo -e DEVICE=bond1.12\\nBRIDGE=vlanbr0\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.12
echo -e DEVICE=vlanbr0\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr0
### End VLAN 12

### VLAN 10
echo -e DEVICE=bond1.10\\nBRIDGE=vlanbr1\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.10
echo -e DEVICE=vlanbr1\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr1
### End VLAN 10

### VLAN 17
echo -e DEVICE=bond1.17\\nBRIDGE=vlanbr2\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.17
echo -e DEVICE=vlanbr2\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr2
### End VLAN 17

### VLAN 11
echo -e DEVICE=bond1.11\\nBRIDGE=vlanbr3\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.11
echo -e DEVICE=vlanbr3\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr3
### End VLAN 11


#
# Xen configuration
#

# Modify xen config file to set right params for network and min memory amount for xen
sed -i -e '/(network-script network-bridge)/a (network-script /bin/true)' -e '/(dom0-min-mem 256)/a (dom0-min-mem 1024)' -e '/(network-script network-bridge)/ s/^/#/' -e '/(dom0-min-mem 256)/ s/^/#/' /etc/xen/xend-config.sxp

# Configure xen migration
sed -i -e '/#(xend-relocation-server no)/a (xend-relocation-server yes)' -e '/#(xend-relocation-port 8002)/a (xend-relocation-port 8002)' /etc/xen/xend-config.sxp
sed -i -e "/#(xend-relocation-address '')/a (xend-relocation-address '10.1.0.2')" -e '/^(xend-relocation-hosts-allow*/ s/^/#/' -e "//a (xend-relocation-hosts-allow '')" /etc/xen/xend-config.sxp

### Hosts configuration
sed -i -e '/^127.0.0.1/a 127.0.0.1\tlocalhost.localdomain localhost ' -e '/^127.0.0.1/D' /etc/hosts
echo 10.1.0.2   node1.exemple.com node1 >> /etc/hosts
echo 10.1.0.4   node2.exemple.com node2 >> /etc/hosts
echo 10.1.0.6   node3.exemple.com node3 >> /etc/hosts
echo 10.1.0.8   node4.exemple.com node4 >> /etc/hosts
### End Host configuration

#
# EOF
#####