2. Install cobbler and prerequisites

We’ll be focusing on installing on a RPM based system such as Fedora, CentOS or AlmaLinux.

  1. Enable EPEL repositories

    [root@master ~]# yum update
    [root@master ~]# yum install epel-release
    
  2. Install cobbler via yum

    [root@master ~]# yum install cobbler
    
  3. Enable and start services needed for cobbler

    enable Apache and cobbler service

    [root@master ~]# systemctl enable httpd
    [root@master ~]# systemctl enable cobblerd
    [root@master ~]# systemctl start httpd
    [root@master ~]# systemctl start cobblerd
    
  4. Run cobbler check to verify installation

    [root@master ~]# cobbler check
    The following are potential configuration items that you may want to fix:
    
    1: The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or automatic installation features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
    2: For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
    3: some network boot-loaders are missing from /var/lib/cobbler/loaders. If you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, and yaboot.
    4: reposync is not installed, install yum-utils or dnf-plugins-core
    5: yumdownloader is not installed, install yum-utils or dnf-plugins-core
    6: debmirror package is not installed, it will be required to manage debian deployments and repositories
    7: ksvalidator was not found, install pykickstart
    8: The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
    9: fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
    
    Restart cobblerd and then run 'cobbler sync' to apply changes.
    

    The output of this check is self-explanatory. Several default settings should be adjusted and some missing pieces need to be installed. Some things, like Debian support are optional.

  5. Set the server and next_server to your master server IP

    The main configuration file for cobbler is /etc/cobbler/settings.yaml and is in YAML format.

    Your cobbler server is responsible for the installation process. This will happen over the cluster network subnet we configured 192.168.16.0/20. Configure cobbler to use the master.hpc IP address.

    server: 192.168.16.1
    ...
    next_server: 192.168.16.1
    
  6. Download boot loaders (optional)

  7. Install yum-utils rsyncd

    [root@master ~]# yum install yum-utils
    
  8. Install pykickstart to validate Kickstart files

    [root@master ~]# yum install pykickstart
    
  9. Restart cobblerd daemon

    [root@master ~]# cobbler sync
    task started: 2025-05-27_043253_sync
    task started (id=Sync, time=Tue May 27 04:32:53 2025)
    running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
    running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
    shell triggers finished successfully
    running pre-sync triggers
    cleaning trees
    removing: /var/lib/tftpboot/pxelinux.cfg/default
    removing: /var/lib/tftpboot/grub/grub.cfg
    removing: /var/lib/tftpboot/grub/images
    removing: /var/lib/tftpboot/grub/local_legacy.cfg
    removing: /var/lib/tftpboot/grub/system
    removing: /var/lib/tftpboot/grub/local_efi.cfg
    removing: /var/lib/tftpboot/grub/local_powerpc-ieee1275.cfg
    removing: /var/lib/tftpboot/grub/system_link
    copying bootloaders
    running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
    received on stdout:
    received on stderr:
    running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
    received on stdout:
    received on stderr:
    copying distros to tftpboot
    copying images
    generating PXE configuration files
    generating PXE menu structure
    cleaning link caches
    running post-sync triggers
    running python triggers from /var/lib/cobbler/triggers/sync/post/*
    running python trigger cobbler.modules.sync_post_restart_services
    running shell triggers from /var/lib/cobbler/triggers/sync/post/*
    shell triggers finished successfully
    running python triggers from /var/lib/cobbler/triggers/change/*
    running python trigger cobbler.modules.scm_track
    running python trigger cobbler.modules.managers.genders
    running shell triggers from /var/lib/cobbler/triggers/change/*
    shell triggers finished successfully
    *** TASK COMPLETE ***
    
    [root@master tftpboot]# yum install tree
    [root@master tftpboot]# tree /var/lib/tftpboot/
    /var/lib/tftpboot/
    ├── boot
    ├── etc
    ├── grub
    │   ├── grub.cfg
    │   ├── images -> ../images
    │   ├── local_efi.cfg
    │   ├── local_legacy.cfg
    │   ├── local_powerpc-ieee1275.cfg
    │   ├── system
    │   └── system_link
    ├── grub.cfg
    ├── images
    ├── images2
    ├── ldlinux.c32
    ├── libutil.c32
    ├── lpxelinux.0
    ├── memdisk
    ├── menu.c32
    ├── ppc
    ├── pxelinux.0
    ├── pxelinux.cfg
    │   └── default
    └── s390x
    
    10 directories, 8 files
    

    By default cobbler only manages TFTP and generates the necessary files in /var/lib/tftpboot/. The rest of the exercise will be about how to configure cobbler to manage DHCP and DNS for us.