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.7/;s/^\(pxe_just_once:\).*/\1 1/;s/^\(server:\).*/\1 10.29.49.7/;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
# Configure DHCPd
sed -i.orig 's/^DHCPDARGS=.*/DHCPDARGS="eth0"/' /etc/sysconfig/dhcpd
SPP_INITRD=`ls /data/hp/HP_Service_Pack_for_Proliant/pxe/spp*/initrd.img`
SPP_KERNEL=`ls /data/hp/HP_Service_Pack_for_Proliant/pxe/spp*/vmlinuz`
cobbler distro add --name=hp-sos --arch=i386 --kernel=$SPP_KERNEL --initrd=$SPP_INITRD \
--kopts '!kssendmac !ksdevice !lang !text rw root=/dev/ram0 init=/bin/init loglevel=3 splash=verbose showopts media=net iso1=nfs://10.29.49.7/data/hp/HPSPP.iso iso1mnt=/mnt/bootdevice iso1opts=nolock,timeo=600 d3bug'
cobbler profile add --name="Firmware_Upgrade-Automatic" --distro=hp-sos --kopts="TYPE=AUTOMATIC AUTOPOWEROFFONSUCCESS=no AUTOREBOOTONSUCCESS=yes" --kickstart=""
cobbler profile add --name="Firmware_Upgrade-Interactive" --distro=hp-sos --kopts="TYPE=MANUAL AUTOPOWEROFFONSUCCESS=no" --kickstart=""
cobbler profile add --name="Firmware_Upgrade-Automatic_POWEROFF" --distro=hp-sos --kopts="TYPE=AUTOMATIC" --kickstart=""
service cobblerd restart
chkconfig cobblerd on
service httpd restart
chkconfig httpd on
chkconfig dhcpd on
service xinetd restart
cobbler sync
# Just for sure
chkconfig iptables off
service iptables stop
@Sharkrit

This comment has been minimized.

Copy link

commented Jan 29, 2016

Hi, Will this script also apply to HP SPP v2015.10 (HPSUM 7.50)?

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.