Cobbler and yum in RHEL 4.6
https://linux-old.xvx.cz/2009/06/cobbler-and-yum-in-rhel-46/
Look at small how-to install cobbler with yum on RHEL 4.6 from scratch.
Install RHEL 4.6 or CentOS 4.6 with default partitioning and custom installation (unselect all possible packages during installation procedure). Disable firewall and SELinux.
Enable DVD repository by changing the line in
/etc/yum.repos.d/CentOS-Media.repo:1
enabled=1
Install yum:
1
mount /media/cdrom
Download packages and install them:
1 2
mkdir /var/tmp/cobbler-4.6 cd /var/tmp/cobbler-4.6 || exit
1 2 3 4 5 6 7
rpm -i ./python-elementtree-1.2.6-5.el4.centos.x86_64.rpm \ ./python-urlgrabber-2.9.8-2.noarch.rpm ./sqlite-3.3.6-2.x86_64.rpm \ ./python-sqlite-1.1.7-1.2.1.x86_64.rpm \ ./yum-metadata-parser-1.0-8.el4.centos.x86_64.rpm \ ./centos-yumconf-4-4.5.noarch.rpm \ ./yum-2.4.3-4.el4.centos.noarch.rpm \ ./createrepo-0.4.4-2.noarch.rpm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
yum clean all mkdir /var/tmp/rhel4_repo/ ln -s /media/cdrom/RedHat/RPMS/ /var/tmp/rhel4_repo/RPMS createrepo /var/tmp/rhel4_repo/ cat > /etc/yum.repos.d/RHEL-4.6-Media.repo << + [rhel4-media] name=RHEL4 - Media baseurl=file:///var/tmp/rhel4_repo/ gpgcheck=0 enabled=1 + createrepo /var/tmp/cobbler-4.6/ cat >> /etc/yum.repos.d/my.repo << + [my-repo] name=My Repository baseurl=file:///var/tmp/cobbler-4.6/ gpgcheck=0 enabled=1 +
Install necessary software from DVD:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig yum -y install wget mc yum -y install httpd tftp-server mod_python python-devel createrepo rsync mkisofs yum -y install perl-Digest-SHA1 perl-Digest-HMAC perl-Socket6 perl-Time-HiRes sysstat perl-libwww-perl yum -y install libart_lgpl freetype libpng yum -y install logrotate perl-DateManip yum -y install cman yum -y install dhcp bind yum -y install memtest86+ yum -y install cobbler yum -y install munin munin-node php-ldap chkconfig munin-node on yum -y install yum-utils yum -y install syslinux
Disable firewall (just for sure):
1 2
chkconfig --level 2345 iptables off service iptables stopChange line in
/etc/cobbler/settingsto match the IP of the server:1 2 3 4 5 6 7 8 9 10 11
default_password_crypted: "$1$pH3........0B2HB/" default_name_servers: [192.168.0.129] manage_dhcp: 1 manage_dns: 1 manage_forward_zones: [my.domain.cz] manage_reverse_zones: [192.168.0] next_server: 192.168.0.129 pxe_just_once: 1 server: 192.168.0.129 register_new_installs: 0 xmlrpc_rw_enable: 1
Start cobbler and apache daemon:
1 2 3
/etc/init.d/cobblerd start /etc/init.d/httpd start chkconfig httpd on
Change ‘disable’ to ‘no’ in
/etc/xinetd.d/tftp:1
disable = yes
Cobbler/DHCPd/bind configuration
Change listening interface for dhcpd in
/etc/sysconfig/dhcpd:1
DHCPDARGS=eth0;
Modify file
/etc/cobbler/dhcp.templateaccording your needs:1 2 3 4 5 6 7 8 9 10 11
subnet 192.168.0.0 netmask 255.255.255.0 { option routers 10.226.23.1; option domain-name "my.domain.cz"; option domain-name-servers 192.168.0.129; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.0.200 192.168.0.254; filename "/pxelinux.0"; default-lease-time 21600; max-lease-time 43200; next-server $next_server; }Modify
/etc/cobbler/named.templatelike:1 2 3 4 5 6 7 8
options { ... # listen-on port 53 { 127.0.0.1; }; ... # allow-query { localhost; }; forwarders { 10.226.32.44; }; ... };1 2 3 4
cobbler sync service xinetd restart chkconfig dhcpd on chkconfig named onNow you should run:
1
cobbler check
and see something like that:
1 2 3
[root@c2virtud tmp]# cobbler check No setup problems found Manual review and editing of /var/lib/cobbler/settings is recommended to tailor cobbler to your particular configuration.
Cobbler repository+ installation
1
2
cobbler import --name=RHEL4.6-x86_64-AS --mirror=/media/cdrom/
cobbler repo add --mirror=/var/tmp/cobbler-4.6/ --name=my-repo
1
2
3
4
5
6
7
cobbler reposync
cobbler image add --name=Memtest86+-1.26 --file=/tftpboot/memtest86+-1.26 --image-type=direct
cobbler profile copy --name=RHEL4.6-AS-x86_64 --newname=NGP_RHEL4.6-AS-x86_64
cobbler profile copy --name=rescue-RHEL4.6-AS-x86_64 --newname=NGP_rescue-RHEL4.6-AS-x86_64
cobbler profile edit --name=NGP_RHEL4.6-AS-x86_64 --repos="my-repo"
cobbler profile edit --name=NGP_rescue-RHEL4.6-AS-x86_64 --repos="my-repo"
cobbler sync
Edit
/etc/yum.repos.d/RHEL-4.6-Media.repoand change one line like:1
baseurl=file:///var/www/cobbler/ks_mirror/RHEL4.6-x86_64-AS/RedHat
Then run:
1
yum clean all
PXE configuration
Make this the first line of
/etc/cobbler/pxe/pxedefault.template,pxeprofile.template,pxesystem.templateto enable serial connection:1
SERIAL 0 115200
Cobbler WebUI
Set root password for web access:
1
htdigest /etc/cobbler/users.digest "Cobbler" rootChange line in
/etc/cobbler/modules.conf:1
module = authn_configfile
1 2
service cobblerd restart service httpd restart
Cobbler host specification
1
2
3
4
5
cobbler system add --comment="c3virt01ce01 machine" --name=c3virt01ce01 --hostname=c3virt01ce01 --netboot-enabled=1 --profile=NGP_RHEL4.6-AS-x86_64 --name-servers=192.168.0.129 --static=0 --kickstart=/var/lib/cobbler/kickstarts/legacy.ks
cobbler system edit --name c3virt01ce01 --interface=eth0 --mac=00:0c:29:68:78:96 --ip=192.168.0.10 --netmask=255.255.255.0 --static=1 --dns-name=c3virt01ce01.my.domain.cz
cobbler system edit --name c3virt01ce01 --interface=eth1 --mac=00:0c:29:68:78:b4 --ip=192.168.1.10 --netmask=255.255.255.0 --static=1
cobbler system edit --name c3virt01ce01 --interface=eth2 --mac=00:0c:29:68:78:aa --ip=192.168.2.10 --netmask=255.255.255.0 --static=1
cobbler system edit --name c3virt01ce01 --interface=eth3 --mac=00:0c:29:68:78:be --static=0
1
cobbler sync
Hope it will be possible to use PXE boot to install machines.