标签:cobber
安装系统:centos_6.5
sed -i ‘/SELINUX/s/enforcing/disabled/‘ /etc/selinux/config
setenforce 0
chkconfig iptables off
service iptables stop
rpm -Uvh ‘http://mirrors.ustc.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm‘
yum install -y cobbler tftp dhcp httpd cman pykickstart debmirror
yum install -y ed patch perl perl-Compress-Zlib perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl
sleep 10
chkconfig httpd on
chkconfig dhcpd on
chkconfig xinetd on
chkconfig cobblerd on
sleep 2
sed -i ‘s/#ServerName www.example.com:80/ServerName 127.0.0.1:80/g‘ /etc/httpd/conf/httpd.conf
service httpd start
netstat -ntulp | grep :80
sleep 5
service cobblerd restart
sleep 1
cobbler check
sed -i ‘s/server: 127.0.0.1/server: 192.168.10.240/g‘ /etc/cobbler/settings
cobbler get-loaders
sleep 5
sed -i ‘/disable/ s/^.*$/ disable = no/g‘ /etc/xinetd.d/tftp
sed -i ‘/disable/ s/^.*$/ disable = no/g‘ /etc/xinetd.d/rsync
service xinetd start
sleep 1
sed -i ‘s/@dists="sid";/#@dists="sid";/g‘ /etc/debmirror.conf
sed -i ‘s/@arches="i386";/#@arches="i386";/g‘ /etc/debmirror.conf
sed -i ‘/default_password_crypted/ s/^.*$/default_password_crypted: "$1$hahaha$vsb1I2cBmYBaA0VxRyixp1"/g‘ /etc/cobbler/settings
sed -i ‘s/manage_dhcp: 0/manage_dhcp: 1/g‘ /etc/cobbler/settings
/etc/init.d/cobblerd restart
cobbler check #这步会报错,说dhcp没启动,按备注dhcp部分修改即可
cobbler sync
上次镜像及制作镜像部分省略(可以查看博主的详细部署博客 http://zhanguo1110.blog.51cto.com/5750817/1411409)
备注
1、DHCP 部分
[root@hscloud_cobbler ~]# vi /etc/dhcp/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Fri Apr 3 07:54:17 2015)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.10.240;
}
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.254;
option subnet-mask 255.255.255.0;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.10.240;
}
# group for Cobbler DHCP tag: default
group {
}
[root@hscloud_cobbler ~]# vi /etc/cobbler/dhcp.template
# ******************************************************************
# Cobbler managed dhcpd.conf file
#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
#
# ******************************************************************
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.254;
option subnet-mask 255.255.255.0;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
#for dhcp_tag in $dhcp_tags.keys():
## group could be subnet if your dhcp tags line up with your subnets
## or really any valid dhcpd.conf construct ... if you only use the
## default dhcp tag in cobbler, the group block can be deleted for a
## flat configuration
# group for Cobbler DHCP tag: $dhcp_tag
group {
#for mac in $dhcp_tags[$dhcp_tag].keys():
#set iface = $dhcp_tags[$dhcp_tag][$mac]
host $iface.name {
hardware ethernet $mac;
#if $iface.ip_address:
fixed-address $iface.ip_address;
#end if
#if $iface.hostname:
option host-name "$iface.hostname";
#end if
#if $iface.netmask:
option subnet-mask $iface.netmask;
#end if
#if $iface.gateway:
option routers $iface.gateway;
#end if
#if $iface.enable_gpxe:
if exists user-class and option user-class = "gPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else if exists user-class and option user-class = "iPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else {
filename "undionly.kpxe";
}
#else
filename "$iface.filename";
#end if
## Cobbler defaults to $next_server, but some users
## may like to use $iface.system.server for proxied setups
next-server $next_server;
## next-server $iface.next_server;
}
#end for
}
#end for
启动DHCP服务 /etc/init.d/dhcpd restart
注:此方式配置的DHCP可以分配多个网段
本文出自 “zhanguo1110” 博客,请务必保留此出处http://zhanguo1110.blog.51cto.com/5750817/1628050
标签:cobber
原文地址:http://zhanguo1110.blog.51cto.com/5750817/1628050