Skip to content

Commit

Permalink
Added Debian 5.0.10 templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jedi4ever committed Sep 4, 2012
1 parent 9a53637 commit 31a3afb
Show file tree
Hide file tree
Showing 20 changed files with 948 additions and 0 deletions.
9 changes: 9 additions & 0 deletions templates/Debian-5.0.10-amd64-netboot/base.sh
@@ -0,0 +1,9 @@
#Updating the box
apt-get -y update
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
apt-get clean

#Setting up sudo
cp /etc/sudoers /etc/sudoers.orig
sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers
2 changes: 2 additions & 0 deletions templates/Debian-5.0.10-amd64-netboot/chef.sh
@@ -0,0 +1,2 @@
# Installing Chef
/usr/bin/gem install chef --no-ri --no-rdoc
10 changes: 10 additions & 0 deletions templates/Debian-5.0.10-amd64-netboot/cleanup.sh
@@ -0,0 +1,10 @@
# Remove items used for building, since they aren't needed anymore
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove

# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp3/*

echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
39 changes: 39 additions & 0 deletions templates/Debian-5.0.10-amd64-netboot/definition.rb
@@ -0,0 +1,39 @@
Veewee::Definition.declare({
:cpu_count => '1',
:memory_size=> '256',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
:os_type_id => 'Debian_64',
:iso_file => "debian-5010-amd64-netinst.iso",
:iso_src => "http://cdimage.debian.org/cdimage/archive/5.0.10/amd64/iso-cd/debian-5010-amd64-netinst.iso",
:iso_md5 => "0e5f0126e271ead360cd10dc0833569a",
:iso_download_timeout => "1000",
:boot_wait => "10", :boot_cmd_sequence => [
'<Esc>',
'install ',
'preseed/url=http://%IP%:%PORT%/preseed.cfg ',
'debian-installer=en_US ',
'auto ',
'locale=en_US ',
'kbd-chooser/method=us ',
'netcfg/get_hostname=%NAME% ',
'netcfg/get_domain=vagrantup.com ',
'fb=false ',
'debconf/frontend=noninteractive ',
'console-setup/ask_detect=false ',
'console-keymaps-at/keymap=us ',
'<Enter>'
],
:kickstart_port => "7122",
:kickstart_timeout => "10000",
:kickstart_file => "preseed.cfg",
:ssh_login_timeout => "10000",
: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 => "halt -p",
:postinstall_files => [ "postinstall.sh" ],
:postinstall_timeout => "10000"
})
60 changes: 60 additions & 0 deletions templates/Debian-5.0.10-amd64-netboot/postinstall.sh
@@ -0,0 +1,60 @@
date > /etc/vagrant_box_build_time

#Updating the box
apt-get -y update
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
apt-get clean

#Setting up sudo
cp /etc/sudoers /etc/sudoers.orig
sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers

#Installing ruby
apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb make g++ libshadow-ruby1.8

# Install RubyGems 1.7.2
wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
tar xzf rubygems-1.7.2.tgz
cd rubygems-1.7.2
/usr/bin/ruby setup.rb
cd ..
rm -rf rubygems-1.7.2*
ln -sfv /usr/bin/gem1.8 /usr/bin/gem

# Installing chef & Puppet
/usr/bin/gem install chef --no-ri --no-rdoc
/usr/bin/gem install puppet --no-ri --no-rdoc

#Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chmod 600 /home/vagrant/.ssh/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
yes|sh /mnt/VBoxLinuxAdditions.run
umount /mnt

apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove

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

# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp3/*

echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
exit

0 comments on commit 31a3afb

Please sign in to comment.