Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 bit CentOS 5.6 template #55

Merged
merged 2 commits into from Jun 27, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions templates/CentOS-5.6-x86_64-netboot/definition.rb
@@ -0,0 +1,16 @@
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.6-x86_64-netinstall.iso",
:iso_src => "http://mirror.ukhost4u.com/centos/5.6/isos/x86_64/CentOS-5.6-x86_64-netinstall.iso",
:iso_md5 => "02cf3a5e32aaa5eed27af775ad292beb",
: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
})
45 changes: 45 additions & 0 deletions templates/CentOS-5.6-x86_64-netboot/ks.cfg
@@ -0,0 +1,45 @@
# Kickstart file automatically generated by anaconda.

install
url --url=http://mirror.bytemark.co.uk/centos/5.6/os/x86_64
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 Europe/London
bootloader --location=mbr
# 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 --drives=sda --initlabel
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=528 --grow --maxsize=1056
logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
reboot

%packages
#@ admin-tools
#@ text-internet
#@ dialup
#@ smb-server
#@ web-server
#@ printing
#@ server-cfg
@ core
grub
e2fsprogs
lvm2

%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
58 changes: 58 additions & 0 deletions templates/CentOS-5.6-x86_64-netboot/postinstall.sh
@@ -0,0 +1,58 @@
#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/

fail()
{
echo "FATAL: $*"
exit 1
}

#kernel source is needed for vbox additions
yum -y install gcc bzip2 make kernel-devel-`uname -r`
#yum -y update
#yum -y upgrade

yum -y install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel
yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
yum -y clean all

#Installing ruby
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz || fail "Could not download Ruby source"
tar xzvf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
./configure
make && make install
cd /tmp
rm -rf /tmp/ruby-1.9.2-p180
rm /tmp/ruby-1.9.2-p180.tar.gz
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

#Installing chef & Puppet
echo "Installing chef and puppet"
/usr/local/bin/gem install chef --no-ri --no-rdoc || fail "Could not install chef"
/usr/local/bin/gem install puppet --no-ri --no-rdoc || fail "Could not install puppet"

#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
chown -R vagrant /home/vagrant/.ssh

#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


sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers

#poweroff -h

exit