Installation system: 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 #这步会报错, said DHCP did not start, according to the comments of the DHCP partial modification can
Cobbler Sync
Last mirror and make Image section omitted (can view blogger's detailed deployment blog http://zhanguo1110.blog.51cto.com/5750817/1411409)
Note
1. DHCP section
[Email Protected]_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'll be
# overwritten.
# ******************************************************************
Ddns-update-style Interim;
Allow booting;
Allow BOOTP;
Ignore client-updates;
Set vendorclass = option Vendor-class-identifier;
Option Pxe-system-type code = 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 {
}
[Email Protected]_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'll be
# overwritten.
#
# ******************************************************************
Ddns-update-style Interim;
Allow booting;
Allow BOOTP;
Ignore client-updates;
Set vendorclass = option Vendor-class-identifier;
Option Pxe-system-type code = 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 is subnet if your DHCP tags line up with your subnets
# # or really any valid dhcpd.conf construct ... if you
# # Default DHCP tag in cobbler, the group block can is 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
# # $iface. System.server for proxied setups
Next-server $next _server;
# # Next-server $iface. Next_server;
}
#end for
}
#end for
Start the DHCP service/ETC/INIT.D/DHCPD restart
Note: DHCP configured in this way can allocate multiple network segments
This article is from the "zhanguo1110" blog, make sure to keep this source http://zhanguo1110.blog.51cto.com/5750817/1628050
Cobbler Rapid Deployment