#vi /etc/cobbler/dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.1.0 netmask 255.255.255.0 {
#option routers 192.168.1.1;
#option domain-name-server 192.168.0.100;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.2 192.168.1.200;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
6 编辑ks文件 模板文件位置位于/var/lib/cobbler/kickstarts/目录下
vi /etc/cobbler/default.ks
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw 123456
# SELinux configuration
selinux –disabled
#disabled serverces
services --disabled acpid,anacron,apmd,atd,auditd,autofs,avahi-daemon,bluetooth,cups,firstboot,hidd,ip6tables,lvm2-monitor,mcstrans,mdmonitor,microcode_ctl,netfs,nfslock,pcscd,portmap,rawdevices,readahead_early,restorecond,rpcgssd,rpcidmapd,sendmail,setroubleshoot,xfs,xinetd,yum-updatesd
#enabled services
services --enabled cpuspeed,crond,gpm,haldaemon,irqbalance,kudzu,messagebus,network,smartd,sshd,syslog
# Do not configure the X Window System
skipx
# System timezone
timezone --utc Asia/Shanghai
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Magically figure out how to partition this thing
%include /tmp/partinfo
%pre
# Determine how many drives we have
set \$(list-harddrives)
#let numd=\$#/2
#d1=\$1
#d2=\$3
cat << EOF >> /tmp/partinfo
clearpart --all --drives=sda --initlabel
part / --fstype ext3 --size=20000
part /usr/local --fstype ext3 --size=50000
part swap --size=1024
part /home --fstype ext3 --size=1000 --grow
#EOF
##
%packages
@admin-tools
@base
@development-libs
@development-tools
@editors
@emacs
@system-tools
%post
$yum_config_stanza
$kickstart_done