Permalink
Browse files

Merge pull request #265 from ringe/master

Added RVM-enabled ubuntu 11.10 template
  • Loading branch information...
2 parents 852847c + 05b657a commit 67f3e78139cf5acc60fbbb6870750eee7d79a6dc @jedi4ever jedi4ever committed Mar 29, 2012
@@ -0,0 +1,35 @@
+Veewee::Session.declare({
+ :cpu_count => '1',
+ :memory_size=> '384',
+ :disk_size => '10140',
+ :disk_format => 'VDI',
+ :hostiocache => 'off',
+ :os_type_id => 'Ubuntu_64',
+ :iso_file => "ubuntu-11.10-server-amd64.iso",
+ :iso_src => "http://releases.ubuntu.com/11.10/ubuntu-11.10-server-amd64.iso",
+ :iso_md5 => "f8a0112b7cb5dcd6d564dbe59f18c35f",
+ :iso_download_timeout => "1000",
+ :boot_wait => "5",
+ :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/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
+ 'initrd=/install/initrd.gz -- <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"
+})
@@ -0,0 +1,85 @@
+# postinstall.sh created from Mitchell's official lucid32/64 baseboxes
+
+date > /etc/vagrant_box_build_time
+
+# Apt-install various things necessary for guest additions,
+# etc., and remove optional things to trim down the machine.
+aptitude -y update
+aptitude -y safe-upgrade
+aptitude -y install linux-headers-$(uname -r)
+
+# Setup sudo to allow no-password sudo for "admin"
+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
+
+# 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
+
+# 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
+
+# Install Ruby Version Manager
+curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer
+chmod +x /tmp/rvm-installer
+/tmp/rvm-installer stable
+
+# Enable RVM for all users
+(cat <<'EOP'
+[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
+EOP
+) > /etc/profile.d/rvm.sh
+echo "gem: --no-rdoc --no-ri" > /home/vagrant/.gemrc
+chown vagrant:vagrant /home/vagrant/.gemrc
+
+# Install Ruby using RVM
+echo "Installing Ruby 1.9.2 as default ruby"
+bash -c '
+ source /etc/profile
+ rvm install 1.9.2-p290
+ rvm alias create default ruby-1.9.2-p290
+ rvm use 1.9.2-p290 --default
+
+ echo "Installing default RubyGems"
+ gem install --no-rdoc --no-ri chef puppet ruby-debug-ide19 ruby-debug-base19 ruby-debug19 rails mysql mysql2'
+
+# Make default user member of RVM group
+usermod -a -G rvm vagrant
+
+# Remove items used for building, since they aren't needed anymore
+aptitude -y remove linux-headers-$(uname -r)
+apt-get -y autoremove
+apt-get -y clean
+aptitude -y autoclean
+
+# 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/*
+
+# Make sure Udev doesn't block our network
+# http://6.ptmc.org/?p=164
+echo "cleaning up udev rules"
+rm /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 "Adding a 2 sec delay to the interface up, to make the dhclient happy"
+echo "pre-up sleep 2" >> /etc/network/interfaces
+exit
@@ -0,0 +1,93 @@
+## 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 USA
+
+# Set optional locale
+#d-i localechooser/supported-locales nb_NO.UTF-8
+
+#d-i netcfg/get_hostname string dummy
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# Continue without a default route
+# Not working , specify a dummy in the DHCP
+#d-i netcfg/no_default_route boolean
+
+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 base-installer/kernel/override-image string linux-image-2.6.32-21-generic
+
+# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
+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 regular
+d-i partman-auto/method string lvm
+#d-i partman-auto/purge_lvm_from_device boolean true
+
+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
+
+#http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
+#Message: "write the changes to disk and configure lvm preseed"
+#http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
+#preseed partman-lvm/confirm_nooverwrite 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, we can get away with a recipe to change this
+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 is puppet and ssh and ntp
+# Individual additional packages to install - various packages needed for Ruby and basic gems
+d-i pkgsel/include string openssh-server ntp vim build-essential openssl libreadline6 libreadline6-dev \
+ curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
+ libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison subversion bash build-essential \
+ libmysqlclient-dev
+
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+d-i pkgsel/upgrade select safe-upgrade
+
+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
+
+#For the update
+d-i pkgsel/update-policy select none
+
+# debconf-get-selections --install
+#Use mirror
+#d-i apt-setup/use_mirror boolean true
+#d-i mirror/country string manual
+#choose-mirror-bin mirror/protocol string http
+#choose-mirror-bin mirror/http/hostname string 192.168.4.150
+#choose-mirror-bin mirror/http/directory string /ubuntu
+#choose-mirror-bin mirror/suite select maverick
+#d-i debian-installer/allow_unauthenticated string true
+
+choose-mirror-bin mirror/http/proxy string

0 comments on commit 67f3e78

Please sign in to comment.