18.linux 中的无人职守安装脚本

anaconda-ks.cfgkickstart脚本:企业安装多台系统时,kickstart代替人工回答系统设定问题的文件。

1.实验环境

 关闭火墙systemctl disabled --now firewalld

查看

 关闭selinux= setenforce o     ;开启

getenforce 查看selinux的开关

 2.dhcp 创建 设置地址池

开启dhcp

3.kickstart文件制作

虚拟机的 httpd 服务打开

cd /root

将其中  anaconda-ks.cfg文件cp到建立的 /var/www/html/ks/westos.ks 中/

编辑文件var/www/html/ks/westos.ks

如下

#version=RHEL8
#ignoredisk --only-use=vda
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
#graphical
text
# Use CDROM installation media
#cdrom
url --url="http://172.25.254.72/westosir/"    镜像所在仓库
# 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 --ipv6=auto --no-activate
network  --hostname=westoslinux.westos.org
repo --name="AppStream" --baseurl=http://172.25.254.72/westosir/AppStream
# Root password
#rootpw --iscrypted $6$zG/VOV5ipdlpG7g1$D8HNdxYK7MpKDD6475WQKYaAx7sSgdxXaRUbL7cjZq2riEwm.FSNQgc.27baOQStDht8tXmtWNlOvk7mEQ6oX1
rootpw --iscrypted $6$J1gR1biu8nQ4TEje$qrtTD1eSZoA.q24X6ckyJS11GVYNd.U8JM3DopPlLBoTBnVY/2DUgSUXaGRUSjv2IiN7UU2ZPPyYgHXdtx7SY

# Run the Setup Agent on first boot
firstboot --disable
# Do not configure the X Window System
skipx
reboot
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
#user --name=westos --password=$6$YAe.8sw6vifDVnKA$3Og7IGTQft5nntRNgMLm0SFntVgYeF/0rU5ui54uKdAAlPv0YI3knIR41Zwvlcjli4j4vVpGVyN2YOzsLsFS91 --iscrypted --gecos="westos"
# Disk partitioning information
part / --fstype="xfs"  --size=1 --grow
part swap --fstype="swap"  --size=500
part /boot --fstype="xfs" --size=1024

%packages
@base
gcc

%end
%post
touch /mnt/file{1..5}


%end

chmod 644  /var/www/html/ks/westos.ks

测试 通过浏览器查看

 

建立虚拟机

virt-manager

图形

 

 上边为镜像地址  下为kickstart文件位置

接着按顺序建立即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值