#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://172.16.54.132/pub/iso"
# Root password
rootpw --iscrypted $1$2Qqm/Tie$jM4DLqGhIUBC/2Ik6VTFW/
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part / --fstype="ext4" --size=10240
part swap --fstype="swap" --size=1024
%post
mkdir /mnt/cdrom
mount /dev/sr0 /mnt/cdrom
echo "mount /dev/sr0 /mnt/cdrom" >> /etc/rc.local
rpm -Uvh ftp://172.16.54.132/pub/iso/Packages/ftp-0.17-53.el6.x86_64.rpm
rpm -Uvh ftp://172.16.54.132/pub/iso/Packages/wget-1.12-1.8.el6.x86_64.rpm
cd /etc/yum.repos.d/
wget ftp://172.16.54.132/pub/repo/epel-release-6-8.noarch.rpm
wget ftp://172.16.54.132/pub/repo/puppetlabs-release-el-6.noarch.rpm
wget ftp://172.16.54.132/pub/repo/CentOS6-Base-163.repo
wget ftp://172.16.54.132/pub/repo/local.repo
rpm -ivh /etc/yum.repos.d/puppetlabs-release-el-6.noarch.rpm
rpm -ivh /etc/yum.repos.d/epel-release-6-8.noarch.rpm
sed -i 3s/^#// /etc/yum.repos.d/epel.repo
sed -i 4s/^/#/ /etc/yum.repos.d/epel.repo
wget ftp://172.16.54.132/pub/host/hostname.sh
echo "sh /etc/yum.repos.d/hostname.sh" >> /etc/rc.local
cd /etc
rm -f /etc/hosts
wget ftp://172.16.54.132/pub/host/hosts
ip=$(ifconfig eth0 | awk 'BEGIN{ FS="[:B]"} /Bcast/{print $2}' | cut -d" " -f1)
i=$(grep $ip /etc/hosts | awk '{print $2}')
>/etc/sysconfig/network
echo "NETWORKING=yes" >> /etc/sysconfig/network
echo "HOSTNAME=$i" >> /etc/sysconfig/network
yum install -y puppet
sed '5a server = master.up.com' /etc/puppet/puppet.conf
/etc/init.d/puppet start
chkconfig puppet on
puppet agent --test
%end
%packages
@base
@chinese-support
-ibus-table-cangjie
-ibus-table-erbi
-ibus-table-wubi
%end
无人值守安装后直接puppet管理脚本
最新推荐文章于 2020-11-11 22:30:07 发布