Automate Multi‑Version OS Deployment with Cobbler
This guide explains how to use Cobbler to automate the batch installation of multiple operating system versions across hundreds of servers, covering installation, DHCP/TFTP/rsync configuration, distro and profile setup, data synchronization, testing, and the optional web interface for streamlined management.
Introduction Operational automation is essential in production environments, especially when managing hundreds or thousands of servers. While PXE can install a single OS version, deploying multiple OS versions requires a more flexible solution; Cobbler provides this capability.
Cobbler Overview Cobbler is a Python‑based tool that wraps PXE to automate OS deployment. It offers CLI and web interfaces, an API for extensibility, and supports physical machines, KVM, Xen, and guest OS installations, as well as integration with configuration management tools like Puppet.
Components The main Cobbler components interact as shown in the diagram below.
Installation
# yum install cobbler -yCobbler depends on DHCP, TFTP, rsync, and DNS services. DHCP can be provided by
dhcpdor
dnsmasq; TFTP by
tftp‑serveror Cobbler itself; rsync by the
rsyncpackage; DNS by
bindor
dnsmasq. These services are managed independently of Cobbler.
Configure DHCP
# yum install dhcp -y
cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
option domain-name "scholar.com";
option domain-name-servers 172.16.0.1;
default-lease-time 43200;
max-lease-time 86400;
log-facility local7;
subnet 172.16.0.0 netmask 255.255.0.0 {
range 172.16.10.60 172.16.10.70;
option routers 172.16.0.1;
next-server 172.16.10.125;
filename "pxelinux.0";
}
service dhcpd startConfigure rsync and TFTP
# chkconfig tftp on
# chkconfig rsync on
service xinetd startConfigure Cobbler
# service cobblerd start
# service httpd start
cobbler check
# Edit /etc/cobbler/settings
server: 172.16.10.125
next_server: 172.16.10.125
# Install missing loaders
cobbler get-loaders
yum install syslinux -y
cp -r /usr/share/syslinux/* /var/lib/cobbler/loaders/
# Set default password
openssl passwd -1 -salt $(openssl rand -hex 4)
# Update /etc/cobbler/settings with default_password_crypted
service cobblerd restartAdd Distro Mount the installation media and import the OS images.
# mount /dev/cdrom /mnt
# cobbler import --name=CentOS6 --path=/mnt
# cobbler import --name=CentOS7 --path=/mntAdd Profile Create or modify a kickstart file to point to the correct repository.
url --url=http://172.16.10.125/cobbler/ks_mirror/CentOS-7.0-x86_64Synchronize Data
# cobbler sync
# For CentOS7, edit /var/lib/tftpboot/pxelinux.cfg/default and add:
inst.repo=http://172.16.10.125/cobbler/ks_mirror/CentOS-7.0-x86_64Deployment Test Set the target machines to network boot, then install CentOS6 and CentOS7 using the configured Cobbler environment. Screenshots illustrate successful boot and installation processes.
Cobbler Web Interface Install the web UI for easier management.
# yum install cobbler-web -y
# vim /etc/cobbler/modules.conf # set module = authn_pam
# useradd cobuser
# echo 'cobpass' | passwd --stdin cobuser
# vim /etc/cobbler/users.conf # add admin = "cobuser"
service cobblerd restart
service httpd restartAccess Test Log in to the Cobbler web console to verify that the configuration and profiles are correctly displayed and can be managed through the UI.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.