Skip to content

Instantly share code, notes, and snippets.

@BlackMaria
Last active December 17, 2015 17:29
Show Gist options
  • Save BlackMaria/5646360 to your computer and use it in GitHub Desktop.
Save BlackMaria/5646360 to your computer and use it in GitHub Desktop.
I typically run something like this after a fresh install
#!/bin/sh
# I typically run something like this after a fresh install
########################################
# What DISTRO are we installing on
########################################
release=rh6
ARCH=x86_64
DISTRO=centos6.4
ISO_DISTRO=CentOS6.4
ISO_ARCH=x86_64
DISTRO_VERS=6.4
########################################
# CONFIGURE personal bashrc stuff
########################################
cat <<BASHRC>>~/.bash_profile
################ BEGIN preferences
export PS1="\n[\[\e[1;36m\]\u\[\e[0m\]@\[\e[1;34m\]\H\[\e[0m\]] [\[\e[1;33m\]\d, \t\[\e[0m\]] [\[\e[1;31m\]\!\[\e[0m\]]\n\[\e[1;31m\]\[\e[0m\][\[\e[1;37m\]\w\[ \e[0m\]]\n\[\e[1;37m\]\\$\[\e[0m\] "
HISTSIZE=100000
HISTFILESIZE=100000
HISTTIMEFORMAT="[%F %T] "
HISTCONTROL=erasedups
export EDITOR=vi
set filec
set autolist
################ END preferences
BASHRC
# source ~/.bash_profile
##############################################
# ADD NETOWRKS Management, Compute and DATA
# in my case eth0 is the world network
# that connects to the DMZ vlan
##############################################
cat <<NIC>>/etc/sysconfig/network-script/ifcfg-mgmt
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.5.1.1
NETMASK=255.255.255.0
PEERDNS=no
#HWADDR=08:00:27:5B:56:72
NIC
cat <<NIC>>/etc/sysconfig/network-script/ifcfg-cmpt
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.5.2.1
NETMASK=255.255.255.0
PEERDNS=no
#HWADDR=08:00:27:5B:56:53
NIC
cat <<NIC>>/etc/sysconfig/network-script/ifcfg-data
DEVICE=eth3
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.5.3.1
NETMASK=255.255.255.0
PEERDNS=no
#HWADDR=08:00:27:5B:56:54
NIC
########################################
# install xcat packages
########################################
yum erase tftp-server.*
cd /etc/yum.repos.d
wget http://xcat.sourceforge.net/yum/xcat-core/xCAT-core.repo
wget http://xcat.sourceforge.net/yum/xcat-dep/${release}/${ARCH}/xCAT-dep.repo
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
########################################
# install RPM KEYS -- very important
########################################
mount /dev/cdrom /mnt &&
for key in /mnt/RPM-GPG-KEY*
do
rpm --import $key
done
########################################
# install xcat packages
########################################
yum clean metadata
yum -y install xCAT
yum -y install yaboot-xcat.noarch
yum -y install net-snmp-utils
yum erase tftp-server.*
yum -y install xCAT-rmc.noarch
yum -y install expect
yum -y install yum-downloadonly
yum -y install ntp net-snmp-utils
yum -y install lynx xauth
yum -y clean metadata
yum -y install xCAT busybox-anaconda
yum -y install yaboot-xcat.noarch
########################################
source /etc/profile.d/xcat.sh
tabdump site
########################################
# SET UP AN NTP SERVER
########################################
\cp -f /usr/share/zoneinfo/America/Montreal /etc/localtime
ntpdate -q 0.centos.pool.ntp.org
ntpdate -bs 0.centos.pool.ntp.org
hwclock -w
chkconfig --level 345 ntpd on
cat <<EOF>/etc/ntp.conf
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
EOF
service ntpd restart
#
########################################
# BUILD A CENTOS MIRROR
########################################
# also see https://gist.github.com/BlackMaria/5646121
copycd-cdrom -a $ARCH -o centos6
########################################
# FINALLY
########################################
echo if this worked you should see the default config info after this text
tabdump site
# And now you can make some nodes
# https://gist.github.com/BlackMaria/5645997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment