Skip to content

Instantly share code, notes, and snippets.

@treydock
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treydock/7d1daf44e7b46d6a484f to your computer and use it in GitHub Desktop.
Save treydock/7d1daf44e7b46d6a484f to your computer and use it in GitHub Desktop.
Kickstart install PerfSONAR
# Steps to extract the contents of perfSONAR NetInstall ISO
# Download ISO and MD5 checksum
wget http://software.internet2.edu/pS-Performance_Toolkit/pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso
wget http://software.internet2.edu/pS-Performance_Toolkit/pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso.md5
md5sum -c pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso.md5
# Mount ISO
mkdir /mnt/perfsonar
sudo mount -o loop pS-Performance_Toolkit-3.4-NetInstall-x86_64.iso /mnt/perfsonar
# Extract ISO
mkdir /tmp/perfsonar
cd /tmp/perfsonar/
cat /mnt/perfsonar/isolinux/initrd.img | xz --format=lzma --decompress --stdout | cpio -id
# The kickstart is in centos6-netinstall.cfg
install
url --url=http://linux.mirrors.es.net/centos/6/os/x86_64
##############################
# System Configuration
##############################
timezone --utc America/Los_Angeles
auth --enableshadow --enablemd5
firstboot --disabled
firewall --disabled
#rootpw --iscrypted Xavf0PU1CJn.U
rootpw --iscrypted saFLGt/QKS6yw
selinux --disabled
skipx
##############################
# Boot configuration
##############################
zerombr
bootloader --location=mbr
#clearpart --all
network --onboot=yes
##############################
# Installation Configuration
##############################
interactive
text
##############################
# Repository Configuration
##############################
repo --name=a-base --baseurl=http://linux.mirrors.es.net/centos/6/os/x86_64 --excludepkgs=kernel*
repo --name=a-updates --mirrorlist=http://software.internet2.edu/rpms/el6/mirrors-Toolkit-CentOS-Updates-x86_64 --excludepkgs=kernel*
repo --name=a-EPEL --mirrorlist=http://software.internet2.edu/rpms/el6/mirrors-Toolkit-EPEL-x86_64
repo --name=a-Internet2 --baseurl=http://software.internet2.edu/rpms/el6/x86_64/main/
repo --name=a-Web100 --baseurl=http://software.internet2.edu/web100_kernel/rpms/el6/x86_64/main/
repo --name=a-DataStax --baseurl=http://rpm.datastax.com/community
##############################
# Install Packages
##############################
%packages
@base
@core
@console-internet
authconfig
bash
binutils
chkconfig
comps-extras
cpp
device-mapper-multipath
gcc
glibc
glibc-common
glibc-devel
glibc-headers
httpd
kernel
kernel-headers
less
libgcc
libgomp
libpcap
mysql-devel
ntp
passwd
patch
perl-DBD-mysql
perl-DBI
php
php-gd
php-snmp
php-xml
policycoreutils
rootfiles
syslinux
system-config-firewall-base
tcpdump
vim-common
vim-enhanced
xkeyboard-config
##############################
# Install Custom Packages
##############################
# EPEL
epel-release
#datastax (cassandra yum repo)
datastax-repo
# sk98lin Kernel Modules
kmod-sk98lin
# Open SSH
openssh-clients
openssh-server
# Web 100
web100_userland
# Internet2 Repository
Internet2-repo
# iperf3
iperf3
# tcptrace and modified xplot
tcptrace
xplot-tcptrace
# perfSonar
bwctl-client
bwctl-server
ndt
npad
nuttcp
owamp-client
owamp-server
perl-perfSONAR_PS-Toolkit
perl-perfSONAR_PS-Toolkit-SystemEnvironment
perl-perfSONAR_PS-LSCacheDaemon
perl-perfSONAR_PS-LSRegistrationDaemon
perl-perfSONAR_PS-MeshConfig-Agent
perl-perfSONAR_PS-SimpleLS-BootStrap-client
%end
##############################
# Run Post Scripts
##############################
%post --log=/root/post_install.log
##############################
# Resize default partition layout.
# Interactive mode breaks partitioning
# commands so have to do it here.
##############################
# Backup /home though probably not much in it
cp -r /home /home.bak
# Remove the partition
umount /dev/mapper/VolGroup-lv_home
lvremove -f /dev/VolGroup/lv_home
# restore home. might already be there by default, hence the somewhat round-about copying
mkdir -p /home
mv /home.bak/* /home/
rm -rf /home.bak/
#Expand the root partition
lvextend -r -l +100%FREE /dev/VolGroup/lv_root
#Update fstab so it doesnt look for /home
grep -v "VolGroup-lv_home" /etc/fstab > /etc/fstab.new
mv -f /etc/fstab.new /etc/fstab
##############################
# Disable Readahead
##############################
sed -i 's/=\"yes\"/=\"no\"/g' /etc/sysconfig/readahead
%end
<%
if proxy = @host.params['kickstart_proxy']
@proxy = " --proxy=#{proxy}"
else
@proxy = ''
end
-%>
install
url --url=http://linux.mirrors.es.net/centos/6/os/x86_64 <%= @proxy %>
##############################
# System Configuration
##############################
lang en_US.UTF-8
keyboard us
timezone --utc America/Chicago
authconfig --enableshadow --passalgo=sha512
firstboot --disabled
firewall --disabled
rootpw --iscrypted <%= root_pass %>
selinux --disabled
skipx
##############################
# Boot configuration
##############################
bootloader --location=mbr <%= grub_pass %>
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
<% if @host.params['din_interface'] and @host.params['din_ipaddress'] -%>
network --bootproto static --device=<%= @host.params['din_interface'] %> --ip=<%= @host.params['din_ipaddress'] %> --netmask=255.255.255.0 --gateway=165.91.55.1 --nameserver=8.8.8.8,128.194.254.1 --hostname <%= @host %>
<% else -%>
network --bootproto <%= @static ? "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" : 'dhcp' %> --hostname <%= @host %>
<% end -%>
##############################
# Installation Configuration
##############################
text
##############################
# Repository Configuration
##############################
repo --name=a-base --baseurl=http://linux.mirrors.es.net/centos/6/os/x86_64 --excludepkgs=kernel* <%= @proxy %>
repo --name=a-updates --mirrorlist=http://software.internet2.edu/rpms/el6/mirrors-Toolkit-CentOS-Updates-x86_64 --excludepkgs=kernel* <%= @proxy %>
repo --name=a-EPEL --mirrorlist=http://software.internet2.edu/rpms/el6/mirrors-Toolkit-EPEL-x86_64 <%= @proxy %>
repo --name=a-Internet2 --baseurl=http://software.internet2.edu/rpms/el6/x86_64/main/ <%= @proxy %>
repo --name=a-Web100 --baseurl=http://software.internet2.edu/web100_kernel/rpms/el6/x86_64/main/ <%= @proxy %>
repo --name=a-DataStax --baseurl=http://rpm.datastax.com/community <%= @proxy %>
reboot
##############################
# Install Packages
##############################
%packages
@base
@core
@console-internet
authconfig
bash
binutils
chkconfig
comps-extras
cpp
device-mapper-multipath
gcc
glibc
glibc-common
glibc-devel
glibc-headers
httpd
kernel
kernel-headers
less
libgcc
libgomp
libpcap
mysql-devel
ntp
passwd
patch
perl-DBD-mysql
perl-DBI
php
php-gd
php-snmp
php-xml
policycoreutils
rootfiles
syslinux
system-config-firewall-base
tcpdump
vim-common
vim-enhanced
xkeyboard-config
##############################
# Install Custom Packages
##############################
# EPEL
epel-release
#datastax (cassandra yum repo)
datastax-repo
# sk98lin Kernel Modules
kmod-sk98lin
# Open SSH
openssh-clients
openssh-server
# Web 100
web100_userland
# Internet2 Repository
Internet2-repo
# iperf3
iperf3
# tcptrace and modified xplot
tcptrace
xplot-tcptrace
# perfSonar
bwctl-client
bwctl-server
ndt
npad
nuttcp
owamp-client
owamp-server
perl-perfSONAR_PS-Toolkit
perl-perfSONAR_PS-Toolkit-SystemEnvironment
perl-perfSONAR_PS-LSCacheDaemon
perl-perfSONAR_PS-LSRegistrationDaemon
perl-perfSONAR_PS-MeshConfig-Agent
perl-perfSONAR_PS-SimpleLS-BootStrap-client
%end
<% if @dynamic -%>
%pre
# Create pre-install script location to pass to post-install
mkdir /tmp/kickstart
<%= @host.diskLayout %>
%end
<% end -%>
##############################
# Run Post Scripts
##############################
%post --log=/root/post_install.log
##############################
# Disable Readahead
##############################
sed -i 's/=\"yes\"/=\"no\"/g' /etc/sysconfig/readahead
<% if @host.params['private_interface'] -%>
##############################
# Disable private interface
##############################
sed -i \
-e 's|^BOOTPROTO=.*|BOOTPROTO=none|g' \
-e 's|^ONBOOT=.*|ONBOOT=no|g' \
-e 's|^NM_CONTROLLED=.*|NM_CONTROLLED=no|g' \
/etc/sysconfig/network-scripts/ifcfg-<%= @host.params['private_interface'] %>
<% end -%>
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
%end
zerombr
clearpart --all --initlabel
part /boot --fstype ext4 --size=500 --asprimary
part pv.01 --size=1 --grow
volgroup VolGroup --pesize=4096 pv.01
logvol swap --name=lv_swap --vgname=VolGroup --recommended
logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --size=1024 --grow
default linux
label linux
kernel boot/CentOS-6.5-x86_64-vmlinuz
append initrd=boot/CentOS-6.5-x86_64-initrd.img ks=<PATH TO KS FILE> ksdevice=bootif network kssendmac
IPAPPEND 2
default linux
label linux
kernel <%= @kernel %>
<% if @host.operatingsystem.major.to_i >= 7 -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> network ks.sendmac
<% else -%>
append initrd=<%= @initrd %> ks=<%= foreman_url("provision")%> ksdevice=bootif network kssendmac
<% end -%>
IPAPPEND 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment