一.kickstart自动安装脚本的作用
用文件来记录所有安装过程中问题的答案,并让所有需要安装的主机自动读取,记录系统安装过程中所有问题答案的文件叫kickstart脚本
二.kickstart自动安装脚本的制作**
#通过模板生成kickstart文件#
在已经装好的rhel8中,/root/anaconda-ks.cfg 就是安装当前系统时回答的所有问题的答案
生成的kickstart,此文件为kickstart模板
#用模板自作kickstart#
在已经装好的rhel8中,/root/anaconda-ks.cfg 就是安装当前系统时回答的所有问题的答案,生成的kickstart,此文件为kickstart模板
cp /root/anaconda-ks.cfg /var/www/html/westos.cfg
vim /var/www/html/westos.cfg
#version=RHEL8
ignoredisk --only-use=sda
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Reboot after installation
reboot
#Use graphical install
graphical
#Keyboard layouts
keyboard --vckeymap=us --xlayouts=‘us’
#System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8
#Network information
network --hostname=westos_student18.westos.org
network --bootproto=dhcp --onboot=on --ipv6=auto --no-activate
repo --name=“AppStream” --baseurl=http://172.25.254.50/westos/AppStream
Use network installation
url --url=“http://172.25.254.50/westos”
#Root password
rootpw --iscrypted
6
6
6GuSHAFGYhhzXwfq2$FXcvQkawaws3NdDcOenvKhw7zbK6lY6BCuH3OqQghy3Ca/MAIqLjVSXd3WOTESXQ811JiBPWjMrFp4FLoml4o/
#X Window System configuration information
xconfig --startxonboot
firstboot --disable
#System services
#services --enabled=“chronyd”
#System timezone
timezone Asia/Shanghai
#Disk partitioning information
part / --fstype=“xfs” --grow --size=1
part /boot --fstype=“xfs” --size=512
part swap --fstype=“swap” --size=4096
%post --nochroot
touch /mnt/westosfile{1…6}
%end
%packages
@base
%end
%end
ksvalidator /var/www/html/westos.cfg 检测westos.cfg语法
chmod 644 /var/www/html/westos.cfg三 在系统安装基面选择
Install Red Hat Enterprise Linux 8.0.0 按TAB
ks=http://172.25.254.20/westos.cfg