Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (64 sloc) 2 KB
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard uk
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$2hLnVnDTS9clSFp3$gxR7Ipx6CG.u5U5UpzFXNtpeDLqZucZr0MEpS6gu.m2bjCPhFka0CEA1HXAkDx4hxefPEt6m75mlZ9ulhm8LN1
user --name=${USERNAME} --password=${USERNAME}
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Europe/London
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
zerombr
clearpart --all --drives=sda
part /boot --fstype=ext4 --size=500
part pv.008002 --grow --size=1
volgroup VolGroup --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200
logvol swap --name=lv_swap --vgname=VolGroup --grow --size=992 --maxsize=992
repo --name="CentOS" --baseurl=file:///mnt/source --cost=100
poweroff
%packages --nobase
@core
%post --log=/root/ks-post.log
#adding root ssh key
cd /root
mkdir --mode=700 .ssh
cat >> .ssh/authorized_keys << EOF
${PUBLIC_KEY}
EOF
chmod 600 .ssh/authorized_keys
#adding soop ssh key
cd /home/${USERNAME}
mkdir --mode=700 .ssh yum
cat >> .ssh/authorized_keys << EOF
${PUBLIC_KEY}
EOF
chmod 600 .ssh/authorized_keys
chown -R ${USERNAME}.${USERNAME} /home/${USERNAME}/.ssh
#Setting up the post install script
cat >> /etc/rc3.d/S99post-install <<'EOF'
#!/bin/sh
logger EXECUTING /etc/rc3.d/S99post-install $1
if [[ $1 != 'start' ]]; then
exit 0
fi
cd /root
KERN_VER=`uname -r`
RPMS="wget make kernel-devel-${KERN_VER} gcc perl"
yum install -y $RPMS
wget http://download.virtualbox.org/virtualbox/${VB_VERSION}/VBoxGuestAdditions_${VB_VERSION}.iso
mkdir /mnt/vbox
mount -o loop VBoxGuestAdditions_${VB_VERSION}.iso /mnt/vbox
/mnt/vbox/VBoxLinuxAdditions.run
umount /mnt/vbox
rmdir /mnt/vbox
rm -f VBoxGuestAdditions_${VB_VERSION}.iso
yum remove -y $RPMS
rm -f /etc/rc3.d/S99post-install
shutdown -P now
EOF
chmod +x /etc/rc3.d/S99post-install
You can’t perform that action at this time.