Low Orbit Flux Logo 2

http://wiki.centos.org/HowTos/NetworkInstallServer    <---!!!!!!!!!!!!
http://www.syslinux.org/wiki/index.php/PXELINUX     <=== really good pxe doc
http://modlearning.com/modules/kickstart/
https://access.redhat.com/site/documentation/en-US/Red_Hat_Network_Satellite/5.3/html/Deployment_Guide/s1-provisioning-kickstarting.html

http://fedoraproject.org/wiki/Anaconda/Kickstart



system-config-kickstart 

==============================================

mount /dev/cdrom /media

 cd /etc/yum.repos.d/
rm -f *.repo

vi local.repo


[Local-Media]
name=CentOS-$releasever - Media
baseurl=file:///media/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


yum clean all
 yum repolist


 yum install -y httpd

rpm -qa | grep httpd
chkconfig httpd on
 chkconfig --list httpd




cd /var/www/html
mkdir -p pub/kickstart
###wrong### cp -R /media/* /var/www/html/pub/
###wrong### cp -R /mnt/RHEL5.2_x64_disk1/Server/* /var/www/html/pub/
cp -r /mnt/RHEL5.2_x64_disk1/Server /var/www/html/pub/
cp -r /mnt/RHEL5.2_x64_disk1/images /var/www/html/pub/


cd pub/kickstart
sample.cfg
 openssl passwd -1      # enter a password to create a hash
rootpw --iscrypted $1$jp8guCvs$T8IiVIAlBUzxvvz8DaEcq.
rootpw --iscrypted $1$TLD/3yRf$ubHkGvhcinLD6zXbCnrLY1

iptables -F
service iptables save
service iptables restart


vi /etc/selinux/config
SELINUX=disabled
shutdown -r now
OR
getsebool -a | grep httpd_disable
setsebool -P httpd_disable_trans=1
getsebool -a | grep httpd_disable



service httpd start
service httpd status


 

========================================

yum install dhcp

chkconfig --level 3 dhcpd on

service dhcpd start


vi /etc/dhcpd.conf 
-------------------------------
ignore unknown-clients;
authoritative;
ddns-updates off;
ddns-update-style interim;
ignore client-updates;


allow booting;
allow bootp;

subnet 10.0.0.0 netmask 255.0.0.0
{
    default-lease-time 600;
    max-lease-time 7200;
    option subnet-mask 255.0.0.0;
    option broadcast-address 10.255.255.255;
    option routers 10.0.0.1;
    option domain-name-servers 10.0.0.1, 10.0.0.2;
    option domain-name "test.lab";

    range 10.0.0.2 10.0.0.100;
}

host mongo1
{
    hardware ethernet 08:00:27:26:D2:E4;
    fixed-address 10.0.0.101;
    option host-name "mongo1.test.lab";
    next-server 10.0.0.1;
    filename "pxelinux.0";
}
------------------------------------------




#Don't use this:
#allow booting;
#allow bootp;
#class "PXE" {
#  match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
#  next-server 192.168.2.1;
#  filename "pxelinux.0";
#}





vi /etc/xinetd.d/tftp
    disable = no

chkconfig xinetd on
/sbin/service xinetd start





=====================================


cd /tftpboot
cp /usr/lib/syslinux/pxelinux.0 .    # rhel5
cp /usr/lib/syslinux/menu.c32 .      # rhel5


cp -r /mnt/RHEL5.2_x64_disk1/images/pxeboot rhel5
mkdir pxelinux.cfg

vi pxelinux.cfg/default
-----------------------------------
DEFAULT menu.c32
PROMPT 0
TIMEOUT 300
ONTIMEOUT localdisk
MENU TITLE PXE Network Boot

LABEL localdisk
    MENU LABEL ^Local Hard Drive
    MENU DEFAULT
    LOCALBOOT 0


LABEL install_64bit
    MENU LABEL ^my build 1
    KERNEL rhel5/vmlinuz
    APPEND ks=http://10.0.0.1/ks.cfg initrd=rhel5/initrd.img ramdisk_size=100000


/var/www/html/ks.cfg
--------------------------------------
install
lang en_US.UTF-8
keyboard us
key --skip
text
skipx
 
url --url http://10.0.0.1/pub
#network --device eth0 --hostname KS-Client --bootproto=static --ip=192.168.0.151 --netmask=255.255.255.0
## also used on reconnecting to network for stage2
network --device eth0 --hostname KS-Client --bootproto=static --ip=10.0.0.101 --netmask=255.0.0.0
rootpw --iscrypted $1$TLD/3yRf$ubHkGvhcinLD6zXbCnrLY1
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --permissive
timezone --utc America/New_York
 
clearpart --all --drives=sda --initlabel
bootloader --location=mbr --driveorder=sda
part /boot --fstype ext3 --size=100
part swap --size=2000
part / --fstype ext3 --size=5000 --grow

%packages
@ Core
@ Base
openssh-clients
openssh-server


%post

wget http://10.0.0.1/pub/custom/python-simplejson-2.0.9-8.el5.x86_64.rpm
rpm -i python-simplejson-2.0.9-8.el5.x86_64.rpm

sed -i 's/10.0.0.101/192.168.0.101/' /etc/sysconfig/network-scripts/ifcfg-eth0 
sed -i 's/255.0.0.0/255.255.255.0/' /etc/sysconfig/network-scripts/ifcfg-eth0 
---------------------------------------------------------








##cd /var/lib/tftpboot
cd /tftpboot
cp /usr/share/syslinux/pxelinux.0 .
cp /usr/share/syslinux/menu.c32 .
mkdir -p pxelinux.cfg centos/i386 centos/x86_64
CENTOS=/var/www/html/centos/6/os
cp $CENTOS/i386/images/pxeboot/* centos/i386
cp $CENTOS/x86_64/images/pxeboot/* centos/x86_64


chkconfig tftp on
service xinetd restart




vi pxelinux.cfg/default
----------------------------------
DEFAULT menu.c32
PROMPT 0
TIMEOUT 300
ONTIMEOUT localdisk
MENU TITLE PXE Network Boot

LABEL localdisk
    MENU LABEL ^Local Hard Drive
    MENU DEFAULT
    LOCALBOOT 0


LABEL install_64bit
    MENU LABEL ^CentOS 6.0 (64-bit) Install
    KERNEL centos/x86_64/vmlinuz
    APPEND ks=http://NETINSTALL-HOST/ks/b64.ks initrd=centos/x86_64/initrd.img ramdisk_size=100000








Setup for multiple configurations and multiple hosts:
=========================================================

cd /tftpboot/pxelinux.cfg
cp default 01-08-00-27-26-D2-E4
cp default 01-08-00-27-32-5B-63
cp default 01-08-00-27-58-A1-F2
cp default 01-08-00-27-A2-68-96

sed -i 's/ks.cfg/ks_101.cfg/' 08-00-27-26-D2-E4
sed -i 's/ks.cfg/ks_102.cfg/' 08-00-27-32-5B-63
sed -i 's/ks.cfg/ks_103.cfg/' 08-00-27-58-A1-F2
sed -i 's/ks.cfg/ks_104.cfg/' 08-00-27-A2-68-96

for i in $( ls ); do mv $i `echo $i | tr [:upper:] [:lower:]`; done   ## fix the names cuz PXE boot uses lower case

cp ks.cfg ks_101.cfg && sed -i 's/101/101/' ks_101.cfg 
cp ks.cfg ks_102.cfg && sed -i 's/101/102/' ks_102.cfg
cp ks.cfg ks_103.cfg && sed -i 's/101/103/' ks_103.cfg
cp ks.cfg ks_104.cfg && sed -i 's/101/104/' ks_104.cfg

/etc/dhcpd.conf <============ !!!!!!!!!! add new host entries here !!!!!!!!!!!!!!!

service dhcpd restart