#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# 键盘布局
keyboard --vckeymap=us --xlayouts='us'
# 系统语言
lang en_US.UTF-8
# 禁用防火墙
firewall --disabled
# 网络信息
network --bootproto=dhcp --ipv6=auto --activate
network --hostname=localhost.localdomain
# Root 密码 123456
rootpw --iscrypted $1$6WVLEBH1$k4/Geot6xK66xr4ffGSZI/
# 系统服务
services --enabled="chronyd"
# 系统时区
timezone Asia/Shanghai --isUtc
# 系统引导配置
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# 分区清除信息
clearpart --all --initlabel --drives=sda
# 磁盘分区信息
part / --fstype="ext4" --ondisk=sda --grow
# 安装完自动重启
reboot --eject
#预安装的包
%packages
@^minimal
@core
%end
# 安装完执行
%post
echo -ne "
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535
" >>/etc/security/limits.conf
#set sysctl
true > /etc/sysctl.conf
cat >> /etc/sysctl.conf << EOF
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120
# see details in https://help.aliyun.com/knowledge_detail/39428.html
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2
# see details in https://help.aliyun.com/knowledge_detail/41334.html
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2
fs.file-max=65535kernel.sysrq = 1
kernel.sysrq = 1
EOF
/sbin/sysctl -p
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cat >> /etc/yum.repos.d/CentOS-Base.repo <<EOF
[base]
name=CentOS-\$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/os/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-\$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/updates/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-\$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/extras/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-\$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/\$releasever/centosplus/\$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
Centos 7 自动应答文件
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 一、前言 最近学习了如何使用kickstart文件自动安装系统,在研究了两天后终于成功将系统安装了起来,本文记录我...
- Cobbler简介 使用PXE批量部署时,有一个缺陷,即只能安装单一的操作系统(同一个版本,仅用一个kicksta...
- 安装 确保文件结构如下: 创建~/.vimrc,确保其中内容如下: [root@disconf pydiction...
- 第一步当然是安装各种需要的软件包 完成后你应该会在/etc下发现auto.cifs auto.master或者au...