CentOS7 /root下系统自生成的anaconda-ks.cfg文件(Kickstart file)

一、Centos7.4自动生成的完整Kickstart file文件

[root@localhost ~]# vim anaconda-ks.cfg 
#version=DEVEL
# System authorization information
auth --useshadow --enablemd5
# Install OS instead of upgrade
install
# Use network installation
url --url="http://172.16.70.110/cblr/links/CentOS-7.4-x86_64"
# Use text mode install
text
# Firewall configuration
firewall --enabled
firstboot --disable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network  --bootproto=dhcp --device=eth0 --activate
network  --hostname=localhost.localdomain
# Reboot after installation
reboot
# Root password
rootpw --iscrypted $1$cobbler$sqDDOBeLKJVmxTCZr52/11
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc
# X Window System configuration information
xconfig  --startxonboot
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="xfs" --size=1024
part swap --fstype="swap" --size=2048
part / --fstype="xfs" --size=282495

%pre
set -x -v
exec 1>/tmp/ks-pre.log 2>&1
# Once root's homedir is there, copy over the log.
while : ; do
    sleep 10
    if [ -d /mnt/sysimage/root ]; then
        cp /tmp/ks-pre.log /mnt/sysimage/root/
        logger "Copied %pre section log to system"
        break
    fi
done &
curl "http://172.16.70.110/cblr/svc/op/trig/mode/pre/profile/CentOS-7.4-x86_64" -o /dev/null
# Enable installation monitoring
%end
%post --nochroot
set -x -v
exec 1>/mnt/sysimage/root/ks-post-nochroot.log 2>&1
%end

%post
set -x -v
exec 1>/root/ks-post.log 2>&1

# Start yum configuration
curl "http://172.16.70.110/cblr/svc/op/yum/profile/CentOS-7.4-x86_64" --output /etc/yum.repos.d/cobbler-config.repo
# End yum configuration
# Start post_install_network_config generated code
# End post_install_network_config generated code

# Start download cobbler managed config files (if applicable)
# End download cobbler managed config files (if applicable)
# Start koan environment setup
echo "export COBBLER_SERVER=172.16.70.110" > /etc/profile.d/cobbler.sh
echo "setenv COBBLER_SERVER 172.16.70.110" > /etc/profile.d/cobbler.csh
# End koan environment setup
# begin Red Hat management server registration
# not configured to register to any Red Hat management server (ok)
# end Red Hat management server registration
# Begin cobbler registration
# cobbler registration is disabled in /etc/cobbler/settings
# End cobbler registration
# Enable post-install boot notification
# Start final steps
curl "http://172.16.70.110/cblr/svc/op/ks/profile/CentOS-7.4-x86_64" -o /root/cobbler.ks
curl "http://172.16.70.110/cblr/svc/op/trig/mode/post/profile/CentOS-7.4-x86_64" -o /dev/null
# End final steps
%end
%packages
@base
@compat-libraries
@debugging
@development
chrony
gcc
gcc-c++
glibc
kexec-tools
lrzsz
nmap
openssh
openssl-devel
sysstat
tree
vim
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'
%end

将部分IP等参数更换一下,即可使用。

猜你喜欢

转载自blog.csdn.net/openbox2008/article/details/80083108
今日推荐