-
Notifications
You must be signed in to change notification settings - Fork 63
/
ks.cfg
69 lines (63 loc) · 2.32 KB
/
ks.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
text
install
lang en_US.UTF-8
keyboard us
network --device=eth0 --bootproto=dhcp --activate
rootpw Passw0rd
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
selinux --enforcing
timezone --utc Europe/Bucharest
bootloader --location=mbr --driveorder=sda
#repo --name=VMWare --baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/x86_64/
# Uncomment the following line for cloud-init support
#repo --name="cloud-init" --baseurl=http://repo.prjrd.net/cloud-init/6/x86_64/ --cost 100
zerombr yes
clearpart --all --initlabel
part /boot --fstype ext3 --size=250
part pv.2 --size=5000 --grow
volgroup VolGroup00 --pesize=32768 pv.2
logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=256 --grow --maxsize=512
#reboot
poweroff
%packages
@base
@core
# Uncomment the following line for cloud-init support
#cloud-init
#vmware-tools-esx-kmods
#vmware-tools-esx
%end
%post --log=/root/post.log --erroronfail
set -e
# Disable yum fastestmirror plugin for usage behind a transparent proxy with apt-cacher-ng
/bin/sed -i 's/^enabled=.*$/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
/usr/bin/yum -y update
CDROM_DEV=/dev/cdrom
CDROM_LABEL=`blkid -o value $CDROM_DEV | awk 'NR == 1'`
if [ "$CDROM_LABEL" != "VMware Tools" ]; then
CDROM_DEV=/dev/cdrom1
fi
TMP1=`mktemp -d`
mount -o ro $CDROM_DEV $TMP1
TMP2=`mktemp -d`
pushd .
cd $TMP2
tar zxf $TMP1/VMwareTools-*
umount $TMP1
rmdir $TMP1
cd vmware-tools-distrib/
./vmware-install.pl --default
popd
rm -rf $TMP2
sed -i 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations
sed -i 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSWER yes/g' /etc/vmware-tools/locations
/usr/bin/vmware-config-tools.pl --default
sed -i "/HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-eth*
rm -f /etc/udev/rules.d/70-persistent-net.rules
echo NOZEROCONF=yes >> /etc/sysconfig/network
/bin/sed -i 's/rhgb quiet/quiet console=tty0 console=ttyS0,115200n8/g' /boot/grub/grub.conf
/bin/sed -i 's/^hiddenmenu$/hiddenmenu\nserial\ --unit=0\ --speed=115200\ --word=8\ --parity=no\ --stop=1\nterminal\ --timeout=5\ console\ serial/g' /boot/grub/grub.conf
/bin/sed -i 's/^PasswordAuthentication\ no$/PasswordAuthentication\ yes/g' /etc/ssh/sshd_config
%end