Cobbler

Install

yum -y install cobbler tftp-server dhcp httpd xinetd

Setting

#vi /etc/cobbler/settings 
161: manage_dhcp: 1 
362: server: your_server_ip
cobbler check

dhcp.template

# more 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; 
#if $omapi_enabled 
omapi-port $omapi_port; 
#end if 
 
ignore client-updates; 
set vendorclass = option vendor-class-identifier; 
 
# 
# DHCP Server Configuration file. 
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample   
# 
 
ddns-update-style interim; 
 
allow booting; 
allow bootp; 
 
ignore client-updates; 
set vendorclass = option vendor-class-identifier; 
 
subnet 192.168.0.0 netmask 255.255.0.0 { 
     option routers             192.168.0.1; 
     option domain-name-servers 192.168.0.1; 
     option domain-name         "yepn.net"; 
     option subnet-mask         255.255.0.0; 
     range dynamic-bootp        192.168.0.201 192.168.0.254; 
     filename                   "/pxelinux.0"; 
     default-lease-time         21600; 
     max-lease-time             43200; 
     next-server                $next_server; 
}

IOS file import

Here follows an example of a Cobbler setup for provisioning Centos 5 with x86 architecture, using the most known extra repositories and some sample public mirror.
The same procedure can be easily adapted to other Centos versions or architectures, changing the specified urls and arch options.
You need at least 5Gb of space in /var/www/cobbler for importing the official DVD and not less that 30Gb of space for mirroring the additional repositories.

1 - Initial import from a Centos DVD. Place the DVD in your CD drive:

mount -t auto /dev/hdc /media/cdrom (if not autmounted)  
cobbler import --mirror=/media/cdrom --name=Centos5 --arch=x86

If you have an ISO, you can import directly from it:

mount -t auto -o loop  /path/to/file.iso /mnt/  
cobbler import --mirror=/mnt --name=Centos5 --arch=x86  
umount /mnt

After this import, that can last some minutes, the iso or DVD is no longer necessary for cobbler: all its files are copied.

2- Sync and show what has been done: you should hve 2 distros and 2 profiles for normal and xen Centos provisioning.

cobbler sync  
cobbler list  
distro Centos5-x86  
     profile Centos5-x86  
distro Centos5-xen-x86  
     profile Centos5-xen-x86

2-1

cobbler profile add --name=任意 --distro=ディストリビューション名 --kickstart=<ks_fileのパス> 
ディストリビューション名はcobbler report を実行した際のdistro項目を参照する 
nameは分かりやすい任意の名前にする 
キックスタートでそれぞれ実行する。 
 
※ /var/lib/cobbler/kickstartsにキックスタート設定ファイル by default

3- Add extra repositories from sample mirrors (find a list of official mirrors on Centos site)
Updates:

cobbler repo add --name=Centos5-UPDATES --mirror=ftp://ftp.sunet.se/pub/Linux/distributions/centos/5/updates/i386/ --priority=40 --createrepo-flags="-c cache" --arch=x86

CentosPlus:

cobbler repo add --name=Centos5-CENTOSPLUS --mirror=ftp://ftp.sunet.se/pub/Linux/distributions/centos/5/centosplus/i386/ --priority=40 --createrepo-flags="-c cache" --arch=x86

Extras:

cobbler repo add --name=Centos5-EXTRAS --mirror=ftp://ftp.sunet.se/pub/Linux/distributions/centos/5/extras/i386/ --priority=40 --createrepo-flags="-c cache" --arch=x86

EPEL:

cobbler repo add --name=Centos5-EPEL --mirror=http://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/epel/5/i386/ --priority=50 --createrepo-flags="-c cache"

RPMFORGE (Dag and Others):

cobbler repo add --name=Centos5-RPMFORGE --mirror=http://apt.sw.be/redhat/el5/en/i386/dag/ --priority=90 --createrepo-flags="-c cache"

Note that EPEL and RPMFORGE may have problems when used at the same time. The use of priorities should solve most of them. If you want to use both, decide which one has to be selected first (lower priority) in case of conflicting packages.

4- Mirror your mirrors

cobbler sync   #(syncs the newly added repos)  
cobbler reposync   #(makes a local mirror or the defined mirrors, requires Internet connection and may take a lot of time, especially at the first run).

It's a good practice to make a daily cron run of “cobbler reposync” in order to have your mirrors automatically updated.

/home1/yepnnet/public_html/wiki/data/pages/cobbler.txt · 最后更改: 2010/06/02 00:40 由 admin
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0