Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apt-get -y update
apt-get -y upgrade
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
apt-get -y install vim
apt-get -y install dkms
apt-get -y install nfs-common
1 change: 1 addition & 0 deletions templates/ubuntu-14.04.2-server-amd64/build_time.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
date > /etc/vagrant_box_build_time
3 changes: 3 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GEM=gem

$GEM install chef --no-ri --no-rdoc
16 changes: 16 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apt-get -y autoremove

dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY

echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*

echo "cleaning up udev rules"
rm -f /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm /lib/udev/rules.d/75-persistent-net-generator.rules

echo "pre-up sleep 2" >> /etc/network/interfaces
exit
46 changes: 46 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/definition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Veewee::Session.declare({
:cpu_count => '1',
:memory_size => '512',
:disk_size => '65536',
:disk_format => 'VDI',
:hostiocache => 'off',
:os_type_id => 'Ubuntu_64',
:iso_file => "ubuntu-14.04.2-server-amd64.iso",
:iso_src => "http://releases.ubuntu.com/14.04.2/ubuntu-14.04.2-server-amd64.iso",
:iso_md5 => "83aabd8dcf1e8f469f3c72fff2375195",
:iso_download_timeout => "1000",
:boot_wait => "4",
:boot_cmd_sequence => [
'<Esc><Esc><Enter>',
'/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
'hostname=%NAME% ',
'fb=false debconf/frontend=noninteractive ',
'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=us keyboard-configuration/variant=us console-setup/ask_detect=false ',
'initrd=/install/initrd.gz -- <Enter>'
],
:kickstart_port => "7122",
:kickstart_timeout => "300",
: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 => "shutdown -P now",
:postinstall_files => [
"build_time.sh",
"apt.sh",
"sudo.sh",
"vagrant.sh",
"ruby.sh",
"chef.sh",
"puppet.sh",
"vbox.sh",
# "parallels.sh",
"cleanup.sh"
],
:postinstall_timeout => "10000"
})
9 changes: 9 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/parallels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Install the Parallels Tools
PARALLELS_TOOLS_ISO=prl-tools-lin.iso
mount -o loop $PARALLELS_TOOLS_ISO /media/cdrom
/media/cdrom/install --install-unattended-with-deps --progress
umount /media/cdrom

# Cleanup
# rm $PARALLELS_TOOLS_ISO

61 changes: 61 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Options to set on the command line
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string us

d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

d-i time/zone string UTC
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true

d-i kbd-chooser/method select American English

d-i netcfg/wireless_wep string

d-i base-installer/kernel/override-image string linux-server

d-i debconf debconf/frontend select Noninteractive

d-i pkgsel/install-language-support boolean false
tasksel tasksel/first multiselect standard, ubuntu-server

d-i partman-auto/method string lvm

d-i partman-lvm/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-auto/choose_recipe select atomic

d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true

# Write the changes to disks and configure LVM?
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max

# Default user
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i user-setup/encrypt-home boolean false
d-i user-setup/allow-password-weak boolean true

# Minimum packages (see postinstall.sh)
d-i pkgsel/include string openssh-server ntp

# Upgrade packages after debootstrap? (none, safe-upgrade, full-upgrade)
# (note: set to none for speed)
d-i pkgsel/upgrade select none

d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note

d-i pkgsel/update-policy select none

choose-mirror-bin mirror/http/proxy string
4 changes: 4 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GEM=gem

adduser --system --group --home /var/lib/puppet puppet
$GEM install puppet --no-ri --no-rdoc
11 changes: 11 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apt-get -y install libyaml-0-2 ruby2.0 ruby2.0-dev

# https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1310292
for i in erb gem irb rake rdoc ri ruby testrb
do
dpkg-divert --add --rename --divert /usr/bin/${i}.divert /usr/bin/${i}
update-alternatives --install /usr/bin/${i} ${i} /usr/bin/${i}2.0 1
# ln -sf /usr/bin/${i}2.0 /usr/bin/${i}
done

echo '' > /etc/profile.d/vagrantruby.sh
5 changes: 5 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/sudo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
groupadd -r admin
usermod -a -G admin vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
6 changes: 6 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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
22 changes: 22 additions & 0 deletions templates/ubuntu-14.04.2-server-amd64/vbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Without libdbus virtualbox would not start automatically after compile
apt-get -y install --no-install-recommends libdbus-1-3

# Remove existing VirtualBox guest additions
/etc/init.d/virtualbox-ose-guest-utils stop
rmmod vboxguest
aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils
aptitude -y install dkms

# Install the VirtualBox guest additions
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop $VBOX_ISO /mnt
yes|sh /mnt/VBoxLinuxAdditions.run
umount /mnt

# Temporary fix for VirtualBox Additions version 4.3.10
# issue #12879, see https://www.virtualbox.org/ticket/12879
[ -e /usr/lib/VBoxGuestAdditions ] || ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

# Cleanup
rm $VBOX_ISO