Linux操作系统基础 2.7 -- 无人职守安装脚本

目录

linux的无人职守安装脚本

1、kickstart自动安装脚本

2、实验环境

3、kickstart自动安装脚本的制作


linux的无人职守安装脚本

1、kickstart自动安装脚本

安装多台linux时需要输入多次重复的设定,解决方法如下:
用文件记录安装过程中所有问题的答案,并让所有需要安装的主机自动读取
kickstart作用:
上述解决方案中 记录系统安装过程中所有问题的答案叫做kickstart脚本

2、实验环境

1.主机名称    westosa
2.ip        172.24.254.20
3.火墙,selinux关闭
4.httpd服务开启
5.配置软件仓库能正常工作

3、kickstart自动安装脚本的制作

/root   vim anaconda-ks.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
text
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8

# Network information
network  --bootproto=dhcp --onboot=on
repo --name="AppStream" --baseurl=http://172.25.254.250/rhel8.2/AppStream
# Use network installation
url --url="http://172.25.254.250/rhel8.2"
# Root password
rootpw --iscrypted $6$e3YVL8AQ/uZNdTF/$oJirlIeOOoWKFAG80QEHIYEukHYr4/rZ/qVL2qmwhnCLJgcZCBF63kY6qb/bUUU4ze7AiRbdV4XIjJTJMiLRL0   
##----- openssl passwd -6 -----##
# X Window System configuration information
xconfig  --startxonboot
firstboot --disable
# System services
#services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai
# Disk partitioning information
part swap --fstype="swap" --size=500
part / --fstype="xfs" --size=1 --grow
part /boot --fstype="xfs" --size=500

%packages
@^graphical-server-environment
ibus-libpinyin.x86_64

%end
cp anaconda-ks.cfg /var/www/html/westos.ks
chmod 644 /var/www/html/westos.ks
ls -l /var/www/html/westos.ks

在浏览器打开网址测试
新建虚拟机
Tab键 ks=http://172.25.254.20/westos.ks

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值