无人值守安装后直接puppet管理脚本

#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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值