How to Install and Configure Cobbler on CentOS 7

The original installation instructions I found are here, and unfortunately they didn’t quite work.  I’m starting to notice a trend.  Either my Google-Foo is getting worse, or people are getting lazy with directions.  The Cobbler Quickstart Guide is the best and most up-to-date I have found.  Early in my career I worked with an Engineer who was a wizard with all things Linux.  He helped me with kickstarting boxes, and I never found the time, or I guess, wanted to find the time to learn the system.  It turns out it was easier than I thought.  Now if only I could master regular expression like he could.

  • Disable SELINUX

[root@cobbler tmp]# getenforce

[root@cobbler tmp]# yum -y update[root@cobbler tmp]# yum -y install cobbler cobbler-web dnsmasq syslinux pykickstart xinetd bind fence-agents wget

  • Start the Cobbler Services

systemctl enable cobblerd

systemctl start cobblerd

systemctl enable httpd

systemctl start httpd

cobbler1

  • Change the default password for the Cobbler User

[root@cobbler tmp]# htdigest /etc/cobbler/users.digest “Cobbler” cobbler

  • Edit /etc/cobbler/settings
    • There are a handful of settings that need to be changed here.  Biggest among them is default_password_crypted.  This is the root password for the installed systems.
    • To create this encrypted value run the command

      [root@cobbler tmp]# openssl passwd -1 -salt ‘randomphrase’ ‘Changeme123’

    • Copy the value output and paste in into the field default_password_crypted
    • Other fields include

manage_dhcp: 1
manage_dns: 1
pxe_just_once: 1
next_server: YOURSERVERIP
server: YOURSERVERIP

  • Edit /etc/cobbler/dhcp.template
    • Change the Network related fields to fit your network.
    • The below block is all that needs to be changed

subnet 192.168.1.0 netmask 255.255.255.0 {

option routers             192.168.1.1;

option domain-name-servers 192.168.1.210,192.168.1.211;

option subnet-mask         255.255.255.0;

filename                   “/pxelinux.0”;

default-lease-time         21600;

max-lease-time             43200;

next-server                $next_server;

}

  • Run Check Scripts

[root@cobbler tmp]# cobbler check

The following are potential configuration items that you may want to fix:

1 : debmirror package is not installed, it will be required to manage debian deployments and repositories

2 : 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

  • You will find a handful of items that show up.  For me it showed what services I didn’t have installed and other parts.  The necessary ones are below.  debmirror is not available on CentOS 7.  Essentially it’s just a perl script, and there are handful of posts on how to recreate it on CentOS 7, but I haven’t investigated.
  • Install undocumented Cobbler Dependencies

[root@cobbler tmp]# cobbler get-loaders

  • Restart cobblerd and then run ‘cobbler sync’ to apply changes.

[root@cobbler tmp]# systemctl restart cobblerd

[root@cobbler tmp]# systemctl restart cobblerd

[root@cobbler tmp]# cobbler sync

task started: 2016-11-14_174344_sync

task started (id=Sync, time=Mon Nov 14 17:43:44 2016)

running pre-sync triggers

… COBBLERY STUFF

*** TASK COMPLETE ***

  • Mount and ISO and Import your Distribution

[root@cobbler tmp]# cobbler import –arch=x86_64 –path=/mnt/iso –name=CentOS-7
task started: 2016-11-14_170108_import
task started (id=Media import, time=Mon Nov 14 17:01:08 2016)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/CentOS-7-x86_64:
creating new distro: CentOS-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS-7-x86_64 -> /var/www/cobbler/links/CentOS-7-x86_64
creating new profile: CentOS-7-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/CentOS-7-x86_64 for CentOS-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS-7-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-7-x86_64
looking for /var/www/cobbler/ks_mirror/CentOS-7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-7-x86_64/repodata
*** TASK COMPLETE ***

  • Verify you have a Distro

[root@cobbler tmp]# cobbler distro list

CentOS-7-x86_64

  • Verify you have a Profile

[root@cobbler tmp]# cobbler profile list

CentOS-7-x86_64

  • Create and Install a System

[root@cobbler tmp]# cobbler system add –name=test –profile=CentOS-7-x86-64

[root@cobbler tmp]# cobbler system edit –name=test –interface=eth0 –mac=00:50:56:bf:0e:02 –ip-address=10.0.1.74 –netmask=255.255.255.0 –static=1 –dns-name=test.beaker.local

[root@cobbler tmp]# cobbler system edit –name=test –gateway=10.0.1.1 –hostname=test.beaker.local

Of course you’ll want to substitute the correct MAC, IP,  Netmask, Gateway, and Hostname.  The above settings worked without issue on my vSphere 6 Installation.

Note — If you have a WDS and a Cobbler Server, shut down the one you don’t want to use. I have a WDS System Running, and once I turned it off, Cobbler worked without issue.

After a bit you’ll have a working system

cobbler2

Once you are happy with the system, make sure you remove it from Cobbler.  Be sure to run system list to verify its gone.

[root@cobbler tmp]# cobbler system remove –name=test
[root@cobbler tmp]# cobbler system list
[root@cobbler tmp]#

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s