Tuesday, 22 February 2011

Kickstart a machine using Cobbler

Setup Epel
[root@dhcp ~]# rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Install Cobbler
[root@dhcp ~]# yum install -y cobbler

Add 25151 to selinux
[root@dhcp ~]# semanage port -a -t http_port_t -p tcp 25151

Turn on autostart
[root@dhcp ~]# chkconfig xinetd on
[root@dhcp ~]# chkconfig httpd on
[root@dhcp ~]# chkconfig cobblerd on

Start Services
[root@dhcp ~]# service httpd start
[root@dhcp ~]# service cobblerd start
[root@dhcp ~]# service xinetd start

Check Cobbler
[root@dhcp ~]# cobbler check

Fix any issues that cobbler check brings up

Edit the firewall
 [root@dhcp ~]# vim /etc/sysconfig/iptables

Add

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 25151 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 69 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 69 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Sync Cobbler
[root@dhcp ~]# cobbler sync

Import a distro into cobbler
[root@dhcp ~]# cobbler import --path=/mnt/cdrom/ --name=centos5 --arch=i386

Add a server to cobbler
[root@dhcp ~]# cobbler system add --name=00:0c:29:e5:bb:a0 --profile=centos5-i386
Disable selinux for tftpd
[root@dhcp ~]# setsebool -P tftpd_disable_trans true

No comments:

Post a Comment