Difference between revisions of "Cobbler installation on Ubuntu"

From Define Wiki
Jump to navigation Jump to search
Line 108: Line 108:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Import a CentOS ISO for deployment ==
+
== Import a Ubuntu Server ISO for deployment ==
  
Mount a the CentOS ISO file to a local folder, for example:
+
Mount a the Ubuntu Server ISO file to a local folder, for example:
 
<syntaxhighlight>
 
<syntaxhighlight>
 
mount -o loop ./ubuntu-12.04-server-amd64.iso /media/cdrom
 
mount -o loop ./ubuntu-12.04-server-amd64.iso /media/cdrom

Revision as of 12:56, 3 May 2013

Pre-Requisits

For this installation, we will need to have the following services installed: dhcp, bind & apache.

Install with the following yum command:

root@ubuntu:~# apt-get install apache2 isc-dhcp-server bind9

If necessary, the dhcpd service can be restricted to servicing dhcp requests on just one port. To do this, edit the /etc/default/isc-dhcp-server file and set the following line:

INTERFACES="eth1"

Install Cobbler

root@ubuntu:~# apt-get install cobbler cobbler-web

Restart Apache

root@ubuntu:~# service apache2 restart
 * Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

Add a few more packages to satisfy some cobbler requirements

Install debmirror with yum (needed to manage debian deployments):

root@ubuntu:~# apt-get install debmirror

Install pykickstart with yum (A python library for manipulating kickstart files):

root@ubuntu:~# apt-get install pykickstart

Configure cobbler

Get cobbler to manage dhcp and dns by setting the following in /etc/cobbler/settings:

manage_dhcp: 1
manage_dns: 1

Set server ip addresses in /etc/cobbler/settings:

next_server: 172.28.0.100
server: 172.28.0.100

Confirm the following are set in /etc/cobbler/modules.conf:

[dns]
module = manage_bind

[dhcp]
module = manage_isc

Edit /etc/cobbler/dhcp.template with relevant network information (for example):

# ******************************************************************
# Cobbler managed dhcpd.conf file
#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
#
# ******************************************************************
	
ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

subnet 192.168.42.0 netmask 255.255.255.0 {
     option routers             192.168.42.1;
     option domain-name-servers 192.168.42.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.42.100 192.168.42.150;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
}
. . . . .

Attempt to start dhcpd:

service dhcpd restart

NB: if the dhcpd service isn't running and it fails to start, it may be because the default /etc/dhcpd.conf file is blank. Enter the above information and start the dhcpd service (it needs to be running for cobbler sync (below) to complete fully). The content of /etc/dhcpd.conf will be overwritten with the contents of /etc/cobbler/dhcp.template once cobbler sync has been performed.

Run cobbler check:

cobbler check

Run cobbler sync:

cobbler sync

Import a Ubuntu Server ISO for deployment

Mount a the Ubuntu Server ISO file to a local folder, for example:

mount -o loop ./ubuntu-12.04-server-amd64.iso /media/cdrom

Import the ISO into cobbler:

root@ubuntu:~# cobbler import --name=ubuntu1204 --path=/media/cdrom/ breed=ubuntu --arch=x86_64

Finish with a cobbler sync:

cobbler sync