Created
December 14, 2011 16:28
-
-
Save nemonik/1477294 to your computer and use it in GitHub Desktop.
ks.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Veewee::Session.declare({ | |
:cpu_count => '1', :memory_size=> '384', | |
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on', | |
:os_type_id => 'RedHat_64', | |
:iso_file => "CentOS-5.7-x86_64-bin-DVD-1of2.iso", | |
:iso_src => "http://mirror.steadfast.net/centos/5.7/isos/x86_64/CentOS-5.7-x86_64-bin-DVD-1of2.iso", | |
:iso_md5 => "55eadec0a6e87c5f2883f734d43fdb58", | |
:iso_download_timeout => 1000, | |
:boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ], | |
:kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", | |
:ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", | |
:ssh_host_port => "7222", :ssh_guest_port => "22", | |
:sudo_cmd => "echo '%p'|sudo -S sh '%f'", | |
:shutdown_cmd => "/sbin/halt -h -p", | |
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kickstart file automatically generated by anaconda. | |
install | |
cdrom | |
lang en_US.UTF-8 | |
langsupport --default=en_US.UTF-8 en_US.UTF-8 | |
keyboard us | |
xconfig --card "VMWare" --videoram 16384 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 | |
network --device eth0 --bootproto dhcp | |
rootpw --iscrypted $1$vSG8FjAu$ekQ0grf16hS4G93HTPcco/ | |
firewall --enabled --trust eth0 --ssh | |
selinux --enforcing | |
authconfig --enableshadow --enablemd5 | |
timezone --utc America/New_York | |
bootloader --location=mbr --driveorder=sda | |
# 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 --all --initlabel --drives=sda | |
part /boot --fstype ext3 --size=100 --ondisk=sda | |
part pv.2 --size=0 --grow --ondisk=sda | |
volgroup VolGroup00 --pesize=32768 pv.2 | |
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=512 --grow --maxsize=1024 | |
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow | |
reboot | |
%packages | |
#@admin-tools | |
#@authoring-and-publishing | |
#@base | |
#@cluster-storage | |
#@clustering | |
@core | |
#@dns-server | |
#@development-libs | |
#@development-tools | |
#@dialup | |
#@editors | |
#@emacs | |
#@engineering-and-scientific | |
#@ftp-server | |
#@java | |
#@java-development | |
#@legacy-network-server | |
#@legacy-software-development | |
#@legacy-software-support | |
#@mail-server | |
#@mysql | |
#@network-server | |
#@news-server | |
#@office | |
#@openfabrics-enterprise-distribution | |
#@sql-server | |
#@printing | |
#@ruby | |
#@server-cfg | |
#@sound-and-video | |
#@system-tools | |
#@text-internet | |
#@xen | |
#@web-server | |
#@smb-server | |
#@x-software-development | |
#@base-x | |
#keyutils | |
#kexec-tools | |
#iscsi-initiator-utils | |
#trousers | |
#bridge-utils | |
#fipscheck | |
#device-mapper-multipath | |
#kmod-gnbd-xen | |
#kmod-gfs-xen | |
#python-suds | |
#perl-XML-SAX | |
#perl-Convert-ASN1 | |
#perl-XML-NamespaceSupport | |
#python-imaging | |
#imake | |
#pexpect | |
#java-1.6.0-openjdk | |
#emacs | |
#vnc-server | |
#audit | |
#mesa-libGLU-devel | |
#xorg-x11-server-Xnest | |
#xorg-x11-server-Xvfb | |
%post | |
/usr/sbin/groupadd vagrant | |
/usr/sbin/useradd vagrant -g vagrant -G wheel | |
echo "vagrant"|passwd --stdin vagrant | |
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date > /etc/vagrant_box_build_time | |
fail() | |
{ | |
echo "FATAL: $*" | |
exit 1 | |
} | |
# add EPEL software repository for CentOS 5 | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
# add RPMforge software repository for CentOS 5 | |
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt | |
cd /tmp | |
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
rpm -K rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
rm rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
#cat > /etc/yum.repos.d/srpm.repo <<DELIM | |
#[centos-src] | |
#name=CentOS $releasever - $basearch - Source | |
#baseurl=http://vault.centos.org/5.7/os/SRPMS/ | |
#gpgcheck=1 | |
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 | |
#DELIM | |
# add packages needed to build the base | |
echo "Installing needed packages..." | |
yum -y install gcc gcc-c++ patch libffi libffi-devel libyaml libyaml-devel intltool readline readline-devel zlib zlib-devel openssl-devel make bzip2 autoconf automake libtool bison kernel-devel-`uname -r` sqlite-devel augeas-devel | |
#Install my prefered editor | |
yum -y joe | |
#Install NFS client | |
yum install nfs-utils nfs-utils-lib | |
#yum -y remove wireless-tools | |
yum -y remove gtk2 libX11 hicolor-icon-theme freetype bitstream-vera-fonts | |
echo "Removing obsolete packages..." | |
yum -y upgrade | |
echo "Cleaning yum cache directory..." | |
yum -y clean metadata | |
yum -y clean all | |
# Setup sudo to allow no-password sudo for "vagrant" | |
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers | |
sed -i "s/^\(.*env_keep = \"\)/\1PATH /" /etc/sudoers | |
#Installing ruby | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz || fail "Could not download Ruby source" | |
tar xzvf ruby-1.9.3-p0.tar.gz | |
cd ruby-1.9.3-p0 | |
./configure | |
make && make install | |
cd /tmp | |
rm -rf /tmp/ruby-1.9.3-p0* | |
ln -s /usr/local/bin/ruby /usr/bin/ruby # Create a sym link for the same path | |
ln -s /usr/local/bin/gem /usr/bin/gem # Create a sym link for the same path | |
##Install chef & Puppet | |
echo "Installing chef, puppet, and augeas..." | |
/usr/sbin/useradd puppet | |
gem install chef --no-ri --no-rdoc || fail "Could not install chef" | |
gem install puppet --no-ri --no-rdoc || fail "Could not install puppet" | |
gem install ruby-augeas --no-ri --no-rdoc || fail "Could not install ruby-augeas" | |
#Install vagrant keys | |
echo "Installing vagrant keys..." | |
mkdir /home/vagrant/.ssh | |
chmod 700 /home/vagrant/.ssh | |
cd /home/vagrant/.ssh | |
wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys | |
chmod 600 /home/vagrant/.ssh/authorized_keys | |
chown -R vagrant /home/vagrant/.ssh | |
#Install the virtualbox guest additions | |
echo "Installing the virtualbox guest additions..." | |
VBOX_VERSION=$(cat /home/vagrant/.vbox_version) | |
cd /tmp | |
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso | |
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt | |
sh /mnt/VBoxLinuxAdditions.run | |
umount /mnt | |
rm VBoxGuestAdditions_$VBOX_VERSION.iso | |
# Zero out the free space to save space in the final image: | |
dd if=/dev/zero of=/EMPTY bs=1M | |
rm -f /EMPTY | |
#poweroff -h | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment