Operations 9 min read

Automate Multi-Version OS Deployments with Cobbler

This guide explains how to use Cobbler to automate the batch deployment of multiple operating system versions across hundreds of servers, covering installation, DHCP and TFTP configuration, distro and profile setup, data synchronization, and web interface usage.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Automate Multi-Version OS Deployments with Cobbler

Introduction Operations automation is crucial in production environments, especially when managing hundreds or thousands of servers. While PXE can automate single‑OS installations, deploying multiple OS versions requires a more flexible solution; Cobbler provides that capability.

Cobbler Overview

Cobbler is a Python‑based tool that wraps PXE to enable automated OS deployment. It offers both CLI and web interfaces, an API for integration, and supports physical machines as well as virtualized guests (KVM, Xen). Cobbler can also work with configuration management tools like Puppet.

Components

The main Cobbler components interact as shown in the diagram below.

Implementation Steps

Install Cobbler

# Need epel and updates support
[root@scholar ~]# yum install cobbler -y

Cobbler depends on DHCP, TFTP, rsync, and DNS services, which can be provided by dhcpd, dnsmasq, tftp‑server, rsync, and bind respectively. These services are managed independently of Cobbler.

Configure DHCP

# Cobbler installs tftp‑server and xinetd; DNS is optional, so install DHCP manually
[root@scholar ~]# yum install dhcp -y
[root@scholar ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
[root@scholar ~]# 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";
}
[root@scholar ~]# service dhcpd start

Configure rsync and TFTP

# Enable services
[root@scholar ~]# chkconfig tftp on
[root@scholar ~]# chkconfig rsync on
[root@scholar ~]# service xinetd start

Configure Cobbler

# Start Cobbler and Apache, then run a health check
[root@scholar ~]# service cobblerd start
[root@scholar ~]# service httpd start
[root@scholar ~]# cobbler check
# Fix reported items, e.g. set server and next_server IPs, install missing loaders, etc.
# Edit /etc/cobbler/settings accordingly and restart
[root@scholar ~]# service cobblerd restart

Add Distro

# Mount the installation media
[root@scholar ~]# mount /dev/cdrom /mnt

Import CentOS 6 and CentOS 7 images (ensure the ISO is remounted for each version) and verify successful import with Cobbler commands (screenshots omitted).

Add Profile

# Edit kickstart file to point to the correct repository
url --url=http://172.16.10.125/cobbler/ks_mirror/CentOS-7.0-x86_64

Synchronize Data

# Sync Cobbler configuration
[root@scholar ~]# cobbler sync
# For CentOS 7, adjust the PXE boot configuration
[root@scholar ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
# Add: inst.repo=http://172.16.10.125/cobbler/ks_mirror/CentOS-7.0-x86_64

Deploy and Test

Set the target machine to network boot, reboot, and verify that the correct OS version installs. Screenshots show successful installations of both CentOS 6 and CentOS 7.

Cobbler Web Interface

# Install web UI
[root@scholar ~]# yum install cobbler-web -y
# Configure authentication (using PAM)
[root@scholar ~]# vim /etc/cobbler/modules.conf
[authentication]
module = authn_pam
# Add a user for web login
[root@scholar ~]# useradd cobuser
[root@scholar ~]# echo 'cobpass' | passwd --stdin cobuser
# Grant admin rights
[root@scholar ~]# vim /etc/cobbler/users.conf
[admins]
admin = "cobuser"
# Restart services
[root@scholar ~]# service cobblerd restart
[root@scholar ~]# service httpd restart

Access the Cobbler web UI, log in with the created credentials, and manage distributions, profiles, and systems through the graphical interface.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

automationPXEServer provisioningDHCPCobblerOS deployment
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.