Cobbler全自动安装CentOS(3)

七、修改安装更改kickstart文件
1. 相关知识内容
说明: 
默认kickstart文件是/var/lib/cobbler/kickstarts/sample.ks,需要手动为每个发行版单独指定, 或单独修改。
# cobbler distro list
CentOS-5.9-x86_64
Centos-5.9-xen-x86_64
#

2. 手动创建自定义新的kickstart文件
vi /var/lib/cobbler/kickstarts/centos-5.9.ks

install
text
cdrom
lang zh_CN.UTF-8
keyboard us
reboot
url --url=http://192.168.1.10/cobbler/ks_mirror/Centos-5.9-x86_64
network --device eth0 --bootproto dhcp --noipv6 --hostname oa
rootpw --iscrypted $1$H0bnNoWM$HE1R/mWv6LqbhUGI8Xw/t.
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --initlabel
part /boot --fstype ext3 --size=200 --asprimary
part swap --size=2048
part / --fstype ext3 --size=200 --grow
%packages
@admin-tools
@base
@chinese-support
@core
@development-libs
@development-tools
@dialup
@editors
@gnome-desktop
@games
@graphical-internet
@graphics
@java
@legacy-software-development
@legacy-software-support
@office
@printing
@sound-and-video
@text-internet
@base-x
system-config-kickstart
kexec-tools
iscsi-initiator-utils
fipscheck
squashfs-tools
device-mapper-multipath
sgpio
imake
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest
xorg-x11-server-Xvfb
%post
service sendmail stop


3. 修改profile指定新的KS启动文件,按角色进行分类
说明 
1. 选择Centos-5.9-x86_64,将采用Centos-5.9-x86_64安装源,并通过/var/lib/cobbler/kickstarts/centos-5.9.ks文件进行全自动安装。   
2. 如有其它发行版,导入完镜像后,可以通过以下方式进行修改,否则将采用默认KS进行安装系统。   
3. 也可以采用不同的ks文件来实现个性能自动安装,如下面第三条add命令,添加一个半自动的ks文件。   
4. 如果没有按下面内容修改指定ks文件的话,引导菜单只显示Centos-5.9-x86_64默认一项。指定ks文件后,会在启动菜单中显示。
# cobbler profile edit --name=Centos-5.9-x86_64 --distro=Centos-5.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-5.9.ks

示例: 

# cobbler profile edit --name=Centos-5.9-xen-x86_64 --distro=Centos-5.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-5.9-xen.ks
# cobbler profile add --name=Centos-5.9-half-auto --distro=Centos-5.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-5.9-halfauto.ks

如图所示:

Cobbler全自动安装CentOS

4. 更改profile名称
# cobbler profile rename --name=Centos-5.9-x86_64 --newname=CentOS-5U9-x64

5. 删除profile配置,需要删除的profile名称为Centos-5.9-x86_64,删除后,安装启动菜单相关项消失。
# cobbler profile remove --name=Centos-5.9-x86_64

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/18885.html