#platform=x86, AMD64, or Intel EM64T
# System bootloader configuration
bootloader --location=mbr
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard --vckeymap=us --xlayouts='cn'
# System language
lang en_US.UTF-8
# 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
$SNIPPET('network_config')
# Reboot after installation
reboot

#Root password
rootpw --plaintext hscloud
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai --isUtc
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
part /boot --fstype="xfs" --ondisk=sda --size=500
part swap --fstype="swap" --ondisk=sda --size=8000
part / --fstype="xfs" --ondisk=sda --size=130000

%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
#Enable installation monitoring
$SNIPPET('pre_anamon')
%end


%packages
@base
@core
%end

%post --nochroot
$SNIPPET('log_ks_post_nochroot')
%end


%post
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('download_config_files')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')

rm -rf /etc/yum.repos.d/Cen*
cat >/etc/yum.repos.d/centos_7.0.repo <<-EOF
[centos_7.0]
name=centos_7.0
baseurl=http://192.168.10.240:8080/centos_7.0.repo
enabled=1
priority=10
gpgcheck=0

EOF


yum clean all


yum install vconfig -y

sleep 10

modprobe 8021q

# Start final steps
$SNIPPET('kickstart_done')
# End final steps

%end


#注:上面的ks文件可以自动识别centos7的网卡类型,在cobbler里指定IP可以把IP写到系统识别出来的enp4s0类型的网卡的配置文件里