# http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-kickstart2-options.html install cdrom text skipx network --device eth0 --bootproto dhcp firewall --disabled selinux --disabled user --name=vagrant --groups=wheel --password=vagrant ## required authconfig --enableshadow --enablemd5 bootloader --location=mbr keyboard us lang en_US.UTF-8 rootpw vagrant timezone America/New_York services --disabled=gpm,iscsi,iscsid,nfslock,pcscd,portmap,rpcgssd,rpcidmapd,sendmail,smartd,yum-updatesd reboot # 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 zerombr clearpart --all --initlabel part /boot --fstype ext3 --size=100 part pv.2 --size=0 --grow volgroup VolGroup00 --pesize=32768 pv.2 logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=528 --grow --maxsize=1056 logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow %packages --nobase coreutils initscripts usermode util-linux chkconfig sudo grub e2fsprogs lvm2 yum rpm openssh-clients openssh-server wget curl bash sed gawk tar findutils dhclient -kudzu ## urg. most of this was done in the first of two post-install scripts, but the ## reboot (required after upgrading the kernel) really hoses up veewee. So ## we'll do the bulk of it in the kickstart post setup script. %post #!/bin/bash set -e set -u set -x echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers ## don't let yum install docs echo 'tsflags = nodocs' >> /etc/yum.conf ## choose the best architecture echo 'multilib_policy = best' >> /etc/yum.conf ## prevent yum from keeping old kernels cp /etc/yum.conf /etc/yum.conf.bak sed -i "s/^.*installonly_limit.*/installonly_limit = 0/" /etc/yum.conf echo 'installonlypkgs = ' >> /etc/yum.conf # remove arches we don't want yum -y erase '*.i386' '*.i686' yum -y upgrade ## restore the yum config mv -f /etc/yum.conf.bak /etc/yum.conf ## dhclient complains when --hostname is passed via "network" above sed -i 's/^HOSTNAME=.*$//' /etc/sysconfig/network echo 'HOSTNAME=vagrant-centos.vagrantup.com' >> /etc/sysconfig/network ## hrm, even with "selinux --disabled" above, selinux still appears to be enabled! ## relevant? https://bugzilla.redhat.com/show_bug.cgi?id=690279 sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/sysconfig/selinux ## use single-user mode for install; should be faster sed -i 's/^id:.*$/id:1:initdefault:/' /etc/inittab /sbin/chkconfig --level 1 network on /sbin/chkconfig --level 1 sshd on