您的位置:首页 > 运维架构 > Linux

Centos6.6 ks

2015-09-01 10:55 579 查看
Data:2015/3/29 6:02:27

适用于pxe+kickstart环境

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.1.106/cobbler/ks_mirror/centos6.6-x86_64"
# Root password
rootpw --plaintext centos
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use text mode install
text
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone  Asia/Shanghai
# Network information
network  --bootproto=dhcp --onboot=on --noipv6
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=431
part / --fstype="ext4" --size=18000
part swap --fstype="swap" --size=2048

%packages
@base
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@large-systems
@network-file-system-client
@performance
@perl-runtime
@server-platform
@server-policy
@workstation-policy
pax
oddjob
sgpio
device-mapper-persistent-data
samba-winbind
certmonger
pam_krb5
krb5-workstation
perl-DBD-SQLite
%end

%post --interpreter /bin/bash
IP=`ifconfig eth0 | grep inet | grep -v inet6 | awk -F[' ':]+ '{print $4}'`
MASK=`ifconfig eth0 | grep inet | grep -v inet6 | awk -F[' ':]+ '{print $8}'`
GATE=`route -n | grep UG | awk '{print $2}'`
sed -i "s@\(^H.*=\).*@\1server-$IP@g" /etc/sysconfig/network
sed -i "s@\(^BOOT.*=\).*@\1static@g" /etc/sysconfig/network-scripts/ifcfg-eth0
echo "IPADDR=$IP" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "NETMASK=$MASK" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "GATEWAY=$GATE" >> /etc/sysconfig/network-scripts/ifcfg-eth0
%end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: