# Pitt CS Kickstart file for CentOS 7

#version=RHEL7
install
url --url=http://mirror.cs.pitt.edu/centos/7/os/x86_64
lang en_US.UTF-8
keyboard us
network --bootproto static --device=em4
rootpw  --iscrypted $6$7sdFE9Ue/kviudcW$Kk6WJ/sq8CBYJCUO/eVCwFDVB.Jfw00Huy3hAzW2byfdh9U32jrTgMvFVXFJaYSt9fFhctdII2ak33s6WOFva/
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512 --enablenis --nisdomain=cs --nisserver=lisa.cs.pitt.edu --enablekrb5 --krb5realm=UNIV.PITT.EDU --krb5kdc=univ.pitt.edu --krb5adminserver=pitt-proddc-01.cssd.pitt.edu
selinux --disabled
timezone America/New_York --isUtc
bootloader --location=mbr --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --linux --initlabel

part /boot/efi --fstype=vfat --size=200 --ondisk=sda
part /boot --fstype=xfs --size=1000 --ondisk=sda
part swap --recommended --ondisk=sda
part / --grow --size=1 --ondisk=sda

part /data/01 --fstype=xfs --fsoptions defaults,noatime --ondisk=sdb
part /data/02 --fstype=xfs --fsoptions defaults,noatime --ondisk=sdc
part /data/03 --fstype=xfs --fsoptions defaults,noatime --ondisk=sdd
part /data/04 --fstype=xfs --fsoptions defaults,noatime --ondisk=sde
part /data/05 --fstype=xfs --fsoptions defaults,noatime --ondisk=sdf
part /data/06 --fstype=xfs --fsoptions defaults,noatime --ondisk=sdg

repo --name="CentOS"  --baseurl=http://mirror.cs.pitt.edu/centos/7/os/x86_64/ --cost=100
repo --name="CentOS 7 - x86_64 - Updates" --baseurl=http://mirror.cs.pitt.edu/centos/7/updates/x86_64/
#repo --name="Extra Packages for Enterprise Linux 7 - x86_64" --baseurl=http://mirror.cs.pitt.edu/epel/7/x86_64/

%packages
%pre
DISKS="/dev/sda"
for DISK in ${DISKS}; do
    parted -s ${DISK} print 2>&1 |grep "unrecognised disk label" > /dev/null
    if [ $? -eq 0 ]; then
        parted -s ${DISK} mklabel msdos
    fi
done
%end
%post
( wget -O /tmp/files.tar http://install.cs.pitt.edu/centos7/proto/files.tar
  cd /
  tar xfp /tmp/files.tar
  sh /tmp/install
  chmod 1777 /tmp
  systemctl disable cups.service
  systemctl disable postfix.service
  echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >> /etc/rc.local
  echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local
  curl -s http://linux.dell.com/repo/hardware/dsu/bootstrap.cgi | bash
  yum -y install srvadmin-all
  curl http://archive.cloudera.com/cm5/redhat/7/x86_64/cm/cloudera-manager.repo -o /etc/yum.repos.d/cloudera-manager.repo
  sync
) 1>/root/post_install.log 2>&1
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end
