Setting up Cobbler for Centos 5

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

3- Add extra repositories from sample mirrors (find a list of official mirrors on Centos site)
cobbler repo add --name=Centos5-UPDATES --mirror= --priority=40 --createrepo-flags="-c cache" --arch=x86
cobbler repo add --name=Centos5-CENTOSPLUS --mirror= --priority=40 --createrepo-flags="-c cache" --arch=x86
cobbler repo add --name=Centos5-EXTRAS --mirror= --priority=40 --createrepo-flags="-c cache" --arch=x86
cobbler repo add --name=Centos5-EPEL --mirror= --priority=50 --createrepo-flags="-c cache"
RPMFORGE (Dag and Others):
cobbler repo add --name=Centos5-RPMFORGE --mirror= --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.

Privacy Policy