Thursday, January 22, 2009

Cobbler on CentOS 5

rpm -Uvh

yum install cobbler
service cobblerd start

web Interface
vim /etc/cobbler/modules.conf
module = authn_configfile

- might use default password or change it to cobbler with:
htdigest /etc/cobbler/users.digest "Cobbler" cobbler

Run with:
username: cobbler, password: cobbler

# the web interface didn't work till I created this file and added entry for cobbler in hosts file
vim /etc/httpd/conf.d/cobbler_my.conf

<VirtualHost *:80>
ServerName cobbler
DocumentRoot /var/www/cobbler

service httpd restart
service cobblerd restart

vim /etc/cobbler/settings
next_server: ''
server: ''
manage_dhcp: 1

vim /etc/xinetd.d/tftp
disable = no

vim /etc/cobbler/dhcp.template
subnet netmask {
option routers;
option domain-name-servers;
option subnet-mask;
range dynamic-bootp;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;

service cobblerd restart
service xinetd start
service dhcpd start

chkconfig cobblerd on
chkconfig xinetd on
chkconfig dhcpd on

#if got errors with dhcpd, repeat:
vim /etc/cobbler/dhcp.template
cobbler sync
service dhcpd start
less /var/log/messages

ks menu
# yet to be done - don't want a menu
# might add systems:
#00:0c:29:46:17:d1 i386
#00:0c:29:70:55:9a x86_64


vim /etc/cobbler/pxedefault.template

download image
#make download to folder /isos if possible or after download move iso to /isos

mount iso image
mkdir -p /mnt/Centos52
mount -t auto -o loop /isos/CentOS-5.2-i386-bin-DVD.iso /mnt/Centos52
cobbler import --mirror=/mnt/Centos52 --name=CentOS-5.2-i386

#add extra repositories
cobbler repo add --name=CentOS-5.2-i386-UPDATES --mirror= --priority=40 --createrepo-flags="-c cache"

#!schedule daily sync!


Sunny dhabhai said...

hey the explanantion is great but whn i boot my laptop it got tftp n all

on cobbler menu it is just showing (local) n nothing doing some research i got that something i hav to do from GUI menu...what else is missing from my sode :(

Scott Henson said...

I'd put a note in there about selinux. It can cause issues where httpd can't connect to cobblerd. The following solves that.

setsebool -P httpd_can_network_connect true

Then restart httpd and cobblerd for good measure.

Unknown said...

For servers running selinux run this command

semanage port -a -t http_port_t -p tcp 25151