kickstart自动安装的应答文件anaconda-ks.cfg

2024-04-10 01:18

本文主要是介绍kickstart自动安装的应答文件anaconda-ks.cfg,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

自动安装应答文件kickstart

  • anaconda是Linux系统安装程序
  • 自动安装应答文件,称为kickstart文件,用于保存安装过程需要指定的选项
  • 通过读取事先给定的配置文件自动完成配置,加内核参数:ks=/path实现指明kickstart文件

kickstart文件格式说明

  • kickstart文件主要包括三个部分:命令段,程序包段,脚本段

命令段:

  • 指明各种安装前配置,如键盘类型等
    命令段中的常见命令:
  • keyboard: 设定键盘类型
  • lang: 语言类型
  • zerombr:清除mbr
  • clearpart:清除分区
  • part: 创建分区
  • rootpw: 指明root的密码
  • timezone: 时区
  • text: 文本安装界面
  • network:指定网络设置
  • firewall:设置防火墙设置
  • selinux:设置selinux设置
  • reboot:安装完自动重启
  • user:安装完成后为系统创建新用户
  • url: 指明安装源

程序包段:

  • 指明要安装的程序包组或程序包,不安装的程序包等
 %packages@^environment group: 指定环境包组,如:@^minimal-environment@group_namepackage
-package
%end

脚本段:

  • %pre: 安装前脚本
  • %post: 安装后脚本

注意:CentOS 8,7,6 不同版本的kickstart文件格式不尽相同,不可混用

CentOS 8 anaconda-ks.cfg

[root@C8-187 ~]# cat anaconda-ks.cfg 
#version=RHEL8
ignoredisk --only-use=sda
# System bootloader configuration
bootloader --append="net.ifnames=0  crashkernel=auto" --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Reboot after installation
reboot
# Use text mode install
text
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8# Network information
network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network  --bootproto=dhcp --hostname=server8.timonium.co
repo --name="AppStream" --baseurl=http://10.0.0.88/centos/8/os/x86_64/AppStream
# Use network installation
url --url="http://10.0.0.88/centos/8/os/x86_64/"
# Root password
rootpw --iscrypted $1$Zmb3GPCH$gNU/fyVaRKbqZeFATib3k/
# SELinux configuration
selinux --disabled
# Run the Setup Agent on first boot
firstboot --enable
# Do not configure the X Window System
skipx
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# Disk partitioning information
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024%post
yum -y install curl
curl 10.0.0.88/shell/newSet.sh | bash
curl 10.0.0.88/shell/sshpass.sh | bash
%end%packages
@^minimal-environment
kexec-tools
kexec-tools%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 anaconda-ks.cfg

[root@c7-199 ~]# cat anaconda-ks.cfg 
#platform=86, AMD64, or Intel EM64T#version=DEVEL
# System authorization information
auth --useshadow  --passalgo=sha512
# Install OS instead of upgrade
install
# Use text mode install
text
# Firewall configuration
firewall --disabled
firstboot --disable
ignoredisk --only-use=sda
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts=''
# System language
lang en_US.UTF-8# Network information
network  --bootproto=dhcp --device=eth0 --activate
network  --hostname=localhost.localdomain
# Reboot after installation
reboot
# Use network installation
url --url="http://10.0.0.88/centos/7/os/x86_64/"
# Root password
rootpw --iscrypted $1$AdkKTbf4$52W.TfzdSQdMmeWt3bbgz0
# SELinux configuration
selinux --disabled
# System services
services --enabled="chronyd"
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --append="net.ifnames=0 crashkernel=auto" --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --size=2048
part /boot --fstype="xfs" --size=1024
part / --fstype="xfs" --size=10240%post
yum -y install curl
curl 10.0.0.88/shell/newSet.sh | bash
curl 10.0.0.88/shell/sshpass.sh | bash
%end%packages
@core
chrony
kexec-tools%end%addon com_redhat_kdump --enable --reserve-mb='auto'%end

这篇关于kickstart自动安装的应答文件anaconda-ks.cfg的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/889725

相关文章

IDEA如何让控制台自动换行

《IDEA如何让控制台自动换行》本文介绍了如何在IDEA中设置控制台自动换行,具体步骤为:File-Settings-Editor-General-Console,然后勾选Usesoftwrapsin... 目录IDEA如何让控制台自http://www.chinasem.cn动换行操作流http://www

vscode保存代码时自动eslint格式化图文教程

《vscode保存代码时自动eslint格式化图文教程》:本文主要介绍vscode保存代码时自动eslint格式化的相关资料,包括打开设置文件并复制特定内容,文中通过代码介绍的非常详细,需要的朋友... 目录1、点击设置2、选择远程--->点击右上角打开设置3、会弹出settings.json文件,将以下内

Python脚本实现自动删除C盘临时文件夹

《Python脚本实现自动删除C盘临时文件夹》在日常使用电脑的过程中,临时文件夹往往会积累大量的无用数据,占用宝贵的磁盘空间,下面我们就来看看Python如何通过脚本实现自动删除C盘临时文件夹吧... 目录一、准备工作二、python脚本编写三、脚本解析四、运行脚本五、案例演示六、注意事项七、总结在日常使用

python管理工具之conda安装部署及使用详解

《python管理工具之conda安装部署及使用详解》这篇文章详细介绍了如何安装和使用conda来管理Python环境,它涵盖了从安装部署、镜像源配置到具体的conda使用方法,包括创建、激活、安装包... 目录pytpshheraerUhon管理工具:conda部署+使用一、安装部署1、 下载2、 安装3

龙蜥操作系统Anolis OS-23.x安装配置图解教程(保姆级)

《龙蜥操作系统AnolisOS-23.x安装配置图解教程(保姆级)》:本文主要介绍了安装和配置AnolisOS23.2系统,包括分区、软件选择、设置root密码、网络配置、主机名设置和禁用SELinux的步骤,详细内容请阅读本文,希望能对你有所帮助... ‌AnolisOS‌是由阿里云推出的开源操作系统,旨

Ubuntu系统怎么安装Warp? 新一代AI 终端神器安装使用方法

《Ubuntu系统怎么安装Warp?新一代AI终端神器安装使用方法》Warp是一款使用Rust开发的现代化AI终端工具,该怎么再Ubuntu系统中安装使用呢?下面我们就来看看详细教程... Warp Terminal 是一款使用 Rust 开发的现代化「AI 终端」工具。最初它只支持 MACOS,但在 20

mysql-8.0.30压缩包版安装和配置MySQL环境过程

《mysql-8.0.30压缩包版安装和配置MySQL环境过程》该文章介绍了如何在Windows系统中下载、安装和配置MySQL数据库,包括下载地址、解压文件、创建和配置my.ini文件、设置环境变量... 目录压缩包安装配置下载配置环境变量下载和初始化总结压缩包安装配置下载下载地址:https://d

SpringBoot项目启动后自动加载系统配置的多种实现方式

《SpringBoot项目启动后自动加载系统配置的多种实现方式》:本文主要介绍SpringBoot项目启动后自动加载系统配置的多种实现方式,并通过代码示例讲解的非常详细,对大家的学习或工作有一定的... 目录1. 使用 CommandLineRunner实现方式:2. 使用 ApplicationRunne

LinuxMint怎么安装? Linux Mint22下载安装图文教程

《LinuxMint怎么安装?LinuxMint22下载安装图文教程》LinuxMint22发布以后,有很多新功能,很多朋友想要下载并安装,该怎么操作呢?下面我们就来看看详细安装指南... linux Mint 是一款基于 Ubuntu 的流行发行版,凭借其现代、精致、易于使用的特性,深受小伙伴们所喜爱。对

Linux(Centos7)安装Mysql/Redis/MinIO方式

《Linux(Centos7)安装Mysql/Redis/MinIO方式》文章总结:介绍了如何安装MySQL和Redis,以及如何配置它们为开机自启,还详细讲解了如何安装MinIO,包括配置Syste... 目录安装mysql安装Redis安装MinIO总结安装Mysql安装Redis搜索Red