cobbler source code installation

cobbler source code installation

1. Introduction to cobbler

Cobbler is a Linux server installation service. It can quickly install and reinstall physical servers and virtual machines through network boot (PXE). At the same time, it can also manage DHCP, DNS, etc.

Cobbler can be managed in the command line mode, and also provides a Web-based interface management tool (cobbler Web), as well as an API interface, which is convenient for secondary development.

Cobbler is an upgraded version of earlier kickstart. It has the advantages of easy configuration and easy management with its own web interface.

Cobbler has a built-in lightweight configuration management system, but it also supports integration with other configuration management systems, such as Puppet, and does not support SaltStack for the time being.

Link: Official website.

cobbler integrated services

  • PXE service support
  • DHCP service management
  • DNS Service Management (optional bind,dnsmasq)
  • Power management
  • Kickstart service support
  • YUM warehouse management
  • TFTP (required for PXE boot)
  • Apache (provides the installation source of kickstart and customized kickstart configuration)
    Detailed explanation of cobbler configuration file
    The cobbler configuration file directory is in / etc/cobbler
configuration fileeffect
/etc/cobbler/settingscobbler master profile
/etc/cobbler/iso/iso template profile
/etc/cobbler/iso/iso template profile
/etc/cobbler/pxepxe template profile
/etc/cobbler/powerPower profile
/etc/cobbler/user.confweb service authorization profile
/etc/cobbler/users.digestUser name password profile for web access
/etc/cobbler/dhcp.templateConfiguration template of dhcp server
/etc/cobbler/dnsmasq.templateConfiguration template for dns server
/etc/cobbler/tftpd.templateConfiguration template of tftp service
/etc/cobbler/modules.confConfiguration files for modules

cobbler data directory

/var/lib/cobbler/config/Used to store distros, system, profiles and other information configuration files
/var/lib/cobbler/triggers/Used to store user-defined cobbler commands
/var/lib/cobbler/kickstart/The kickstart file is stored by default
/var/lib/cobbler/loaders/Store various boot programs and image directories
/var/www/cobbler/ks_mirror/All data of the imported distribution system
/var/www/cobbler/images/Import the kernel and initrd images of the distribution for remote network startup
/var/www/cobbler/repo_mirror/yum warehouse storage directory

cobbler log file

log file pathexplain
/var/log/cobbler/installingClient installation log
/var/log/cobbler/cobbler.logcobbler log

Detailed explanation of cobbler command

cobbler check       //Check whether there is a problem with the current setting
cobbler list        //Lists all cobbler elements
cobbler report      //Lists the details of the element
cobbler sync        //Synchronize the configuration to the data directory. It is best to change the configuration
cobbler reposync    //Synchronize yum warehouse
cobbler distro      //View imported release system information
cobbler system      //View added system information
cobbler profile     //View configuration information

2. Deployment of cobbler server

//Install epel source
[root@localhost yum.repos.d]# yum -y install epel-release
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

//Turn off firewall
[root@localhost yum.repos.d]# systemctl disable --now firewalld
[root@localhost yum.repos.d]# setenforce 0
[root@localhost yum.repos.d]# 

//Install cobbler and related software
[root@localhost yum.repos.d]# yum -y install httpd tftp
[root@localhost yum.repos.d]# yum -y install dhcp-*
[root@localhost yum.repos.d]# yum -y install xinetd
[root@localhost yum.repos.d]# yum -y install pykickstart
[root@localhost yum.repos.d]# dnf -y install cobbler
[root@localhost yum.repos.d]# dnf -y install cobbler-web
[root@localhost settings.d]# yum -y install syslinux

//Start the service and set the startup self startup
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl start cobblerd
[root@localhost ~]# systemctl enable httpd
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable cobblerd
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/cobblerd.service.

//Modify the ip address of the server to the local ip address
[root@localhost ~]# sed -i 's/^server:' /etc/cobbler/settings.yaml 

//Set the ip address of tftp to the native ip address
[root@localhost ~]# sed -i 's/^next_server:' /etc/cobbler/settings.yaml 

//Modify profile
[root@localhost settings.d]# ls
bind_manage_ipmi.settings  manage_genders.settings  nsupdate.settings
[root@localhost settings.d]# cat bind_manage_ipmi.settings 
# bind_manage_ipmi - used to let bind manage IPMI addresses if the power management address is an IP and if manage_bind
# is set.
bind_manage_ipmi: true
[root@localhost settings.d]# cat manage_genders.settings 
# manage_genders - Bool to enable/disable managing an /etc/genders file for use with pdsh and others.
manage_genders: True
[root@localhost settings.d]# cat nsupdate.settings 
# Set to "true" to enable Cobbler's dynamic DNS updates.
nsupdate_enabled: True

# define tsig key
# please don't use this one, instead generate your own:
#   dnssec-keygen -a HMAC-SHA512 -b 512 -n USER cobbler_update_key
nsupdate_tsig_algorithm: "hmac-sha512"
nsupdate_tsig_key: [ "cobbler_update_key.", "hvnK54HFJXFasHjzjEn09ASIkCOGYSnofRq4ejsiBHz3udVyGiuebFGAswSjKUxNuhmllPrkI0HRSSmM2qvZug==" ]

# if set, enables logging to that file
nsupdate_log: "/var/log/cobbler/nsupdate.log"

[root@localhost settings.d]# 

//Download missing files
[root@localhost ~]# cobbler get-loaders
task started: 2021-10-12_072329_get_loaders
task started (id=Download Bootloader Content, time=Tue Oct 12 07:23:29 2021)
running python triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
shell triggers finished successfully
downloading to /var/lib/cobbler/loaders/README
downloading to /var/lib/cobbler/loaders/COPYING.yaboot
downloading to /var/lib/cobbler/loaders/COPYING.syslinux
downloading to /var/lib/cobbler/loaders/yaboot
path /var/lib/cobbler/loaders/pxelinux.0 already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/menu.c32 already exists, not overwriting existing content, use --force if you wish to update
downloading to /var/lib/cobbler/loaders/grub-x86.efi
downloading to /var/lib/cobbler/loaders/grub-x86_64.efi
[root@localhost ~]# 

Tags: Linux Operation & Maintenance CentOS

Posted on Tue, 12 Oct 2021 22:53:07 -0400 by dankstick