Introduction to Cobbler

Cobbler is a provisioning tool that glues different technologies in order to make easy to build up the components of an efficient provisioning server, perfect for mass or frequent deployment of RedHat/Centos/Fedora Linux systems.
It's done for RedHat based distributions even if it's supposed to work also for Suse and Debian.
It provides in an easy way:
- PXE server support
- DHCP server integration
- Kickstart server with templates  
- Easy yum repository management.
It's client, Koan, can install virtual machines or reinstall an existing metal system.

Official Site      
Cobbler is mainly developed by Michael DeHaan of RedHat.       
The Official site is http://fedorahosted.org/cobbler/ , rpm packages for RedHat / Centos are available in the EPEL repository.      

Basic setup
                              
yum install cobbler                            

Logic is easy:                            
1- you add / import distributions from CD or network                            
2- you add profiles and subprofiles for different kind of installations and kickstart templates                            
3- you may create systems based on existing profiles (MAC or IP addesses can be defined)                            
4- you can add Yum repositories to use with profiles                            
5- cobbler does the rest                            

1 - Import (makes a local copy of files) a distribution CD or ISO to provision with Cobbler                              
mount -t auto -o loop /data/iso/CentOS-5.1-i386-bin-DVD.iso /mnt/                              
cobbler import --mirror=/mnt/ --name=Centos5.1-i386                              
umount /mnt                              
Alternatively add a distro specifying where to find kernel and inird files (less common option).                            
cobbler distro add --name=RedHat5 --kernel=/path/to/vmlinuz--initrd=/path/to/initrd.img                            
                            
2 - Cobbler makes 2 default profiles (normal and xen), you can add more profiles with a command like:                            
cobbler profile add --name=rhel5-base --distro=RHEL-5-i386                      

3- You can  also create specific systems using defined profiles:                            
cobbler system add --name=mailserver --profile=rhel5-base
                            
4- Add repositories to manage with cobbler (you can automatically mirror them):                          
cobbler repo add --name=Centos-5.1-i386-CENTOSPLUS --mirror=ftp://ftp.sunet.se/pub/Linux/distributions/centos/5.1/centosplus/i386/
To refresh the local mirror and recreate repodata  type or place in cron:          
cobbler reposync


5- To apply all the configurations (stored in /var/lib/cobbler ) type cobbler sync
This updates files in:
/tftpboot  (accordind to templates in /etc/cobbler/pxe/*)  
/etc/dhcpd.conf
  (if dhcp support active, according to /etc/cobbler/dhcp.template )
/var/www/cobbler (Visible via web, should not be touched, it's mantained and "cleaned" by Cobbler):  The whole content of imported distros is copied in /var/www/cobbler/ks_mirror.
External repositories file (see below) are copied in /var/www/cobbler/repo_mirror  , kickstart files are generated in /var/www/cobbler/kickstarts  and  /var/www/cobbler/kickstarts_sys

Common commands
cobbler check (verifies if there are problems with current setup)
cobbler list (lists all the cobbler elements)
cobbler report (detailed list of elements)
cobbler sync (syncronizes the configuration to dhcp/pxe and data directories)
cobbler reposync (syncronizes the configured mirrors of external repositories)


Cobbler configuration
Configurations are in /etc/cobbler/settings
Interesting parameters:  
server: '<ip_server>' (the IP of Kickstart server, commonly the cobbler server)  
next_server: '<ip_server>' (the IP of the PXE server, commonly the cobbler server)  
manage_dhcp: 1 (default is "0". Activate it if you want to manage Dhcpd with cobbler. Edit, according to your needs, the template file /etc/cobbler/dhcp.template )  
snippetsdir: /var/lib/cobbler/snippets (Add here custom snippets for kickstart templates)
  
A separate file is available for the configuration of modules and third party addons. In /etc/cobbler/modules.conf you can define what kind of DNS/DHCP server to want to manage and authentication and authorization logics.  

Web Interface  
Most of the options available via the cobbler command line are available via Web. Cobbler web interface can be reached at: http://yourserver/cobbler/web/ .
(Note that in versions somehow older than Cobbler 0.8 it was http://yourserver/cobbler/webui/wui.html).
You can control access to the web interface in different ways, the easiest is to set in /etc/cobbler/modules.conf something like:  
[authentication]
module = authn_configfile  
[authorization]
module = authz_allowall
  
these settings don't set any particular per user authorization scheme and use file based Digest authentication.
To redefine the password of the default "cobbler" user to access the web interface use the command (then restart apache and cobbler):
htdigest /etc/cobbler/users.digest "Cobbler" cobbler

Client side usage
Koan is cobbler's client:
yum install koan
koan --server=192.168.0.42 --list-profiles
(lists available profiles on the Cobbler server)
koan --server=192.168.0.42 --list-systems
(lists available systems, if any)
koan --virt --server=192.168.0.42 --profile=RHEL5-i386  --virt-name=web01 (installs a virtual guest using the indicated profile)
koan --virt --server=192.168.0.42 --profile=RHEL5-i386  --virt-name=web01 --nogfx (installs a virtual guest from a console without graphic support).

Note: Default cobbler installations set "cobbler"  as root password.

Privacy Policy