Back to the main page

Add a distribution into Cobbler

Intro

The first step towards installing a system with Cobbler (v2.6 and 2.8 used here) is to add (or import) a distribution record (an OS to be installed on a client) to Cobbler's configuration.

Design

Distro import can be done manually or using the script I have written, cobbler_distro_import.py

Manual import

An ISO has to be downloaded to Cobbler server (locally, or nfs share) and mounted, before it's imported. Additional notes:

Script

The script I wrote is cobbler_distro_import.py

$ sudo python cobbler_distro_import.py -h

usage: cobbler_distro_import.py [-h] -p PATH -a ARCH [-n NICKNAME]

Import new distro into Cobbler

optional arguments:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  [ HTTP(s) | NFS ] path of an ISO
  -a ARCH, --arch ARCH  Distro architecture, supported are: i386, x86_64, arm
  -n NICKNAME, --nickname NICKNAME
                        Nickname for distribution

Implementation

Manual import

Download ISO, likely on /tmp or some NFS mount.

$ mount -o loop /tmp/<iso file> /mnt
$ cobbler import --path=/mnt --name=<distro_name> \
--arch=<architecture> \ 
--kickstart=/var/lib/cobbler/kickstarts/<ks_file>
$ cobbler distro list                                      # verify work
$ cobbler distro report
$ umount /mnt
$ rm /sascratch/iso/<iso file>                       # cleanup
$ cobbler sync                                      # if you import on master Cobbler

Script

Most likely a distro will be added into Master Cobbler server, hence SSH to it (as yourself) and run "sudo cobbler_distro_import.py" (use -h for the help)
An ISO path: