1、linux自动安装脚本
1、[root@node2 html]# yum install pykickstart.noarch httpd -y 安装脚本的语法检测工具和APache默认发布目录
[root@node2 ~]# systemctl enable --now httpd 开启服务
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@node2 ~]# systemctl disable --now firewalld 关闭火墙
2、[root@node2 html]# cp /root/anaconda-ks.cfg var/www/html/westos.cfg 将安装脚本模板复制到默认发布目录里
3、[root@localhost Desktop]# chmod 777 /var/www/html
4、[root@node2 ~]# chmod 644 /var/www/html/westos.cfg 设定权限
5、node2上开启dhcp服务
6、编写westos.cfg模板
#version=RHEL8
ignoredisk --only-use=vda 安装时使用那块硬盘,可以注释掉
#ignoredisk --only-use=vda
# Partition clearing information
clearpart --none --initlabel
clearpart --all--initlabel 表示把磁盘所有分区清掉
# Use graphical install
graphical —>text 安装过程中是否开图形,text表示纯文本安装
# Use CDROM installation media
#cdrom 光盘安装
url -- url="http:/172.25.254.50/westos" 网络yum源安装
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us' 键盘
# System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8 支持的语言
# Network information
#network --bootproto=dhcp --device=enp1s0 --onboot=off --ipv6=auto --no-activate 网路
network --bootproto=dhcp --onboot=on 网络为dhcp模式并开启网络
network --hostname=localhost.localdomain 主机名不设置,注释掉
#network --hostname=localhost.localdomain
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream 指定yum源
repo --name="AppStream" --baseurl=http://172.25.254.50/westos/AppStream
# Root password 超级用户密码 (加密字符串用openssl passwd -6 生成)
rootpw --iscrypted $6$h