Master Automated Linux Installations with Cobbler: A Step‑by‑Step Guide
This article explains how to use Cobbler, a Python‑based provisioning tool, to set up PXE boot, manage DHCP/DNS/TFTP services, import Linux distributions, configure kickstart templates, and operate the web interface for fully automated system installations.
Introduction
Cobbler is a fast network installation service for Linux (and, with adjustments, Windows) written in Python (about 15 k lines of code). It configures a PXE boot environment, manages DHCP, DNS, yum repositories, and can build ISO images. Cobbler offers command‑line, web UI, and API access, and the Koan client supports virtual‑machine installation and OS re‑installation.
Features Provided by Cobbler
Using Cobbler eliminates manual intervention for installing machines. It sets up a PXE boot environment (including PowerPC support via yaboot) and controls all aspects of installation such as DHCP, TFTP, and repository mirroring. It can:
Configure DHCP using predefined templates.
Create repository mirrors from yum or rsync sources.
Add entries to DHCP configuration with specific IP and MAC addresses.
Generate appropriate PXE files in the TFTP directory.
Restart DHCP and reboot machines to start installation.
Cobbler supports many distributions (Red Hat, Fedora, CentOS, Debian, Ubuntu, SuSE) and can unpack ISO files automatically. It uses kickstart templates with variables such as $domain and $machine_name. Fence scripts enable power‑management integration (apc_snmp, drac, ilo, ipmitool, etc.). Cobbler can also work with external configuration management systems like Chef or Puppet.
Installation and Configuration
Install Cobbler via yum (including cobbler‑web, pykickstart, debmirror):
[root@node1 ~]# yum install cobbler cobbler-web pykickstart debmirror -yRun cobbler check and address the reported items (set proper server and next_server values, install missing loaders, adjust rsync and debmirror settings, change the default password, install fencing tools, etc.).
Example fix commands:
# Edit /etc/cobbler/settings to set server and next_server to the boot server IP
# Run cobbler get-loaders to download required bootloader files
# Enable and configure DHCP, TFTP, rsync, and DNS services either via Cobbler or manuallyService Dependencies
Cobbler relies on DHCP, TFTP, rsync, and DNS. These can be managed by Cobbler (set manage_dhcp, manage_tftpd, manage_rsync, manage_dns in /etc/cobbler/settings) or configured independently (e.g., using /etc/cobbler/modules.conf).
Configure DHCP
# cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
option domain-name "example.com";
option domain-name-servers 192.168.1.201;
default-lease-time 43200;
max-lease-time 86400;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.210 192.168.1.230;
option routers 192.168.1.253;
}
next-server 192.168.1.210;
filename "pxelinux.0";Configure TFTP
# chkconfig tftp onConfigure Cobbler
Import a distribution (e.g., CentOS 6.5):
# mount /dev/cdrom /media
# cobbler import --name=centos6.5-x86-64 --path=/media/List imported distros: # cobbler distro list Create a profile using a kickstart file:
# cobbler profile add --name=centos6.5-x86_64 --distro=centos6.5-64-x86_64 kickstart=/root/anaconda-ks.cfgRestart Cobbler and synchronize data:
# service cobblerd restart
# cobbler syncUsing cobbler_web
The web interface supports various authentication modules ( authn_pam, authn_configfile, authn_ldap, etc.). To enable PAM authentication, edit /etc/cobbler/modules.conf:
[authentication]
module = authn_pamAdd a system user and make it an admin in /etc/cobbler/users.conf:
# useradd adminuser
# passwd adminuser
# echo '[admins]' >> /etc/cobbler/users.conf
# echo 'admin = "adminuser"' >> /etc/cobbler/users.confTesting
After configuration, the custom PXE boot menu appears, allowing you to start the automated installation. Screenshots (shown in the original article) illustrate the boot screen, installation progress, and successful login.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
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.
