Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cobbler installation
# Install EPEL
MAJOR_RELEASE=`sed 's/.* \([0-9]*\)\.[0-9] .*/\1/' /etc/redhat-release`
cd /tmp/
lftp -e "mget /pub/linux/fedora/epel/6/x86_64/epel-release*.noarch.rpm; quit;" http://ftp.fi.muni.cz/
rpm -Uvh ./epel*${MAJOR_RELEASE}*.noarch.rpm
# Install Cobbler
yum install -y cobbler-web fence-agents git hardlink ipmitool dhcp
sed -i.orig 's/module = authn_denyall/module = authn_configfile/' /etc/cobbler/modules.conf
HTDIGEST_HASH=`printf admin:Cobbler:admin123 | md5sum -`
echo "admin:Cobbler:${HTDIGEST_HASH:0:32}" >> /etc/cobbler/users.digest
PASSWORD_HASH=`openssl passwd -1 'admin123'`
sed -i.orig "s/^\(anamon_enabled:\).*/\1 1/;s@^\(default_password_crypted:\).*@\1 \"$PASSWORD_HASH\"@;s/^\(manage_dhcp:\).*/\1 1/;s/^\(next_server:\).*/\1 10.29.49.4/;s/^\(pxe_just_once:\).*/\1 1/;s/^\(server:\).*/\1 10.29.49.4/;s/^\(scm_track_enabled:\).*/\1 1/;s/^power_management_default_type:.*/power_management_default_type: 'ilo'/" /etc/cobbler/settings
# Change DHCPd template
sed -i.orig 's/192.168.1.0/10.29.49.0/;s/192.168.1.5;/10.29.49.1;/;s/192.168.1.1;/10.226.32.44;/;s/255.255.255.0/255.255.255.128/;s/192.168.1.100 192.168.1.254/10.29.49.100 10.29.49.126/;' /etc/cobbler/dhcp.template
# Change PXE template
sed -i.orig '/ONTIMEOUT/a SERIAL 0 115200' /etc/cobbler/pxe/pxedefault.template
# Configure DHCPd
sed -i.orig 's/^DHCPDARGS=.*/DHCPDARGS="eth0"/' /etc/sysconfig/dhcpd
service cobblerd restart
chkconfig cobblerd on
service httpd restart
chkconfig httpd on
chkconfig dhcpd on
service xinetd restart
# Add distro and profiles to Cobbler
cobbler distro add --name=sstk --arch=i386 --kernel=/data/hp/ss-scripting-toolkit-linux/boot_files/vmlinuz --initrd=/data/hp/ss-scripting-toolkit-linux/boot_files/initrd.img \
--kopts '!kssendmac !ksdevice !lang !text root=/dev/ram0 rw ramdisk_size=396452 network=1 sstk_mount=10.29.49.4:/data/hp/ss-scripting-toolkit-linux sstk_mount_type=nfs sstk_mount_options=rw,nolock sstk_script=/shell.sh console=ttyS0,115200n8'
cobbler profile add --name="SSTK-Capture_and_save_system_hardware_settings" --distro=sstk --kopts="sstk_script=/capture.sh img=test_hostname" --kickstart=""
cobbler profile add --name="SSTK-Reset_system_to_factory_defaults" --distro=sstk --kopts="sstk_script=/systemreset.sh img=test_hostname" --kickstart=""
cobbler profile add --name="SSTK-Deploy_Configuration" --distro=sstk --kopts="sstk_script=/deploy.sh img=test_hostname" --kickstart=""
git config --global user.name "Config Git"
git config --global user.email root@cobbler.example.com
cobbler sync
# Just for sure
chkconfig iptables off
service iptables stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.