@mrz1
2018-01-14T06:45:18.000000Z
字数 3437
阅读 802
自动化
sr0 11:0 1 3.7G 0 rom /var/www/html/centos/7
sr1 11:1 1 8.1G 0 rom /var/www/html/centos/6
[root@centos7 ksdir]#cat ks6-desktop.cfg
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
reboot
text
url --url=http://192.168.27.6/centos/6/
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$0ApPfIO1$YGbB.gKGJA3S5klOW/ePF6PjutrSGcTAad5s6lxuP1Gyez3UFPUUl7X7KHzyo.EWq.UVV3kwhgIc4DJitRA8W.
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all
zerombr
part /boot --fstype=ext4 --size=1024
part / --fstype=ext4 --size=50000
part /app --fstype=ext4 --size=20000
part swap --size=2048
%packages
@base
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-applications
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@office-suite
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@workstation-policy
@x11
mtools
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
device-mapper-persistent-data
abrt-gui
samba-winbind
certmonger
pam_krb5
krb5-workstation
libXmu
%end
%post
useradd wang
echo magedu | passwd --stdin wang &> /dev/null
%end
[root@centos7 ksdir]#cat ks7-pxe.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
url --url=http://192.168.109.143/centos/7
# Use graphical install
firewall --disabled
selinux --disabled
text
reboot
# Run the Setup Agent on first boot
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=ens33 --onboot=on --ipv6=auto --activate
network --hostname=centos7.qifei.com
# Root password
rootpw --iscrypted $6$zvNPHt.AnyhKAFGT$GhLgXK5VyYGIgFr60TopFHzVUersaacruSe0MYnVZB4vbGNLHCDPTfbiKW1Ry.V9S9NdGis.qmnP/MSnfXt7R0
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
user --name=fei --password=$6$wrdu0VH2CF1hufHn$FpKs8T.4z65C9HFoDiB8Z6SmERCjBJt2LGhNOvnnDhYzm4Lt58qJ2dryg8mqHvYTnGDp6igP8M0748Hx7i8XW. --iscrypted --gecos="fei"
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
# Partition clearing information
zerombr
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --ondisk=sda --size=2048
part / --fstype="xfs" --ondisk=sda --size=51200
part /boot --fstype="xfs" --ondisk=sda --size=1024
part /app --fstype="xfs" --ondisk=sda --size=20480
eula --agreed
%packages
@base
@core
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@internet-browser
@multimedia
@network-file-system-client
@networkmanager-submodules
@print-client
@x11
%end
%addon com_redhat_kdump --disable --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
%post
rm -f /etc/yum.repo.d/*
cat > /etc/yum.repos.d/base.repo <<EOF
[base]
name = centos7base
baseurl = file:///misc/cd/
gpgcheck = 0
EOF
echo magedu |passwd --stdin fei &> /dev/null
%end