Welcome 微信登录

首页 / 操作系统 / Linux / Kickstart 配置脚本实例

Kickstart 配置脚本实例###############################################################
#
# Sample Kickstart Configuration File
#
###############################################################
###############################################################
#
# point to a local installation server, or use "cdrom"
#
###############################################################
url --url http://rha-server/pub/rhel5/
#cdrom
rootpw RedHat
bootloader --location=mbr --password=redhat
###############################################################
#
# partitioning#
###############################################################
zerombr yes
clearpart --all --initlabel
part /boot --fstype ext3 --size 128
part / --fstype ext3 --size 1 --grow
part swap --recommended
###############################################################
#
# network configuration
# - the following is for the "recommended solution" outlined
# in the Red Hat Academy Instructor"s Guide
#
###############################################################
network --bootproto=dhcp --device=eth0
firewall --disabled
#network --bootproto=static --ip=192.168.0.254 --netmask=255.255.255.0
--device=eth0
#firewall --medium --http --port=https:tcp
###############################################################
#
# environment
#
###############################################################
lang zh_CN.UTF-8
timezone Asia/Shanghai
###############################################################
#
# hardware
#
###############################################################
keyboard us
xconfig --startxonboot
###############################################################
# misc
###############################################################
key --skip # skip install number
authconfig --enableshadow --enablemd5
reboot # reboot automatically when done
install # instead of "upgrade"
###############################################################
#
# Software
#
###############################################################
%packages --resolvedeps
@admin-tools
@editors
@text-internet
@gnome-desktop
@core
@base
@base-x
@chinese-support
@sound-and-video
@graphical-internet
emacs
kexec-tools
device-mapper-multipath
xorg-x11-utils
xorg-x11-server-Xnest
-sysreport
%post
###############################################################
#
# Post Script - the following script runs on the newly
# installed machine, immediately after installation
#
###############################################################
echo "nameserver 192.168.0.254" >> /etc/resolv.conf
rpm -ivh ftp://rha-server/rha/autoupdate/rha-base*.rpm
#rpm -Fvh ftp://Kickstart.example.com/pub/9/i386/updates/*.rpm
#curl http://rha-server/rha/xorg.conf > /etc/X11/xorg.conf
#curl http://rha-server/rha/station.cfg | tar xvzf -
for i in elvis blondie prince madonna; do
useradd $i
echo redhat | passwd --stdin $i
doneKickstart 脚本设计Kickstart 脚本通常有三个不同的部分。 命令部分 软件包部分 安装后脚本部分Anaconda 会忽略Kickstart 脚本中所有以“#”开始的行和空行。命令部分 从文件的最开始直到出现以%packages 开始的行,这一部分都属于命令部分。命令行必须以可识别的关键字开始,并且所有与该关键字有关的参数都必须出现在同一行中。命令部分是用来指定安装程序需要的除软件选项外的所有标准信息。关键字在命令部分可以以任意次序出现。软件包部分(%packages) 软件包部分是用来指定需要安装的软件。这部分从以%packages 开头的行开始,直到下一个以“%”字符开始的行为止。这一部分通常采用以下两种格式之一。 @Component Name package-name 第一种格式是用软件组来指定软件,在这里一定要注意正确拼写软件组名称,并注意大小写。 第二种格式是用来指定要安装的软件包的具体名称。如果%packages 行包含额外的--resolvedeps 参数,那么也会安装解决相依性的软件包。安装后脚本部分(%post) 后处理部分是在没有 Anaconda 安装程序参与下,执行所有新安装系统的机器的自定义过程。执行这部分内容与在新安装系统的机器的环境下运行 Bash Shell 脚本的效果是一样的。如果是网络安装,那么执行前面提到作为实例的脚本也可以激活网络配置。Red Hat 引导 Anaconda 时常用的参数Linux内核开机保留大块内存的方法总结相关资讯      kickstart 
  • Linux运维自动化工具 Kickstart  (04月09日)
  • Nginx DHCP TFTP Kickstart搭建自  (10/29/2015 10:38:15)
  • Kickstart 全自动安装部署RHEL 7.0  (09/20/2015 09:02:26)
  • PXE+Kickstart实现无人值守批量安  (11/11/2015 08:39:04)
  • RHCSA 系列(十二): 使用   (10/02/2015 19:53:58)
  • PXE+Kickstart实现自动安装CentOS   (09/12/2015 18:25:42)
本文评论 查看全部评论 (0)
表情: 姓名: 字数