veewee 0.3.0.beta2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. data/doc/requirements.md +7 -1
  2. data/lib/python/parallels_send_string.py +76 -0
  3. data/lib/veewee/provider/core/helper/scancode.rb +31 -48
  4. data/lib/veewee/provider/parallels/box/helper/console_type.rb +54 -76
  5. data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +2 -2
  6. data/lib/veewee/provider/virtualbox/box/helper/create.rb +1 -1
  7. data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +1 -2
  8. data/lib/veewee/provider/virtualbox/box/helper/version.rb +8 -0
  9. data/lib/veewee/version.rb +1 -1
  10. data/templates/Debian-6.0.5-i386-netboot/virtualbox.sh +1 -1
  11. data/templates/Debian-6.0.6-amd64-netboot/base.sh +27 -0
  12. data/templates/Debian-6.0.6-amd64-netboot/chef.sh +2 -0
  13. data/templates/Debian-6.0.6-amd64-netboot/cleanup-virtualbox.sh +4 -0
  14. data/templates/Debian-6.0.6-amd64-netboot/cleanup.sh +17 -0
  15. data/templates/Debian-6.0.6-amd64-netboot/definition.rb +49 -0
  16. data/templates/Debian-6.0.6-amd64-netboot/preseed.cfg +315 -0
  17. data/templates/Debian-6.0.6-amd64-netboot/puppet.sh +2 -0
  18. data/templates/Debian-6.0.6-amd64-netboot/ruby.sh +10 -0
  19. data/templates/Debian-6.0.6-amd64-netboot/vagrant.sh +25 -0
  20. data/templates/Debian-6.0.6-amd64-netboot/virtualbox.sh +13 -0
  21. data/templates/Debian-6.0.6-amd64-netboot/zerodisk.sh +3 -0
  22. data/templates/Debian-6.0.6-i386-netboot/base.sh +27 -0
  23. data/templates/Debian-6.0.6-i386-netboot/chef.sh +2 -0
  24. data/templates/Debian-6.0.6-i386-netboot/cleanup-virtualbox.sh +4 -0
  25. data/templates/Debian-6.0.6-i386-netboot/cleanup.sh +17 -0
  26. data/templates/Debian-6.0.6-i386-netboot/definition.rb +51 -0
  27. data/templates/Debian-6.0.6-i386-netboot/preseed.cfg +315 -0
  28. data/templates/Debian-6.0.6-i386-netboot/puppet.sh +2 -0
  29. data/templates/Debian-6.0.6-i386-netboot/ruby.sh +10 -0
  30. data/templates/Debian-6.0.6-i386-netboot/vagrant.sh +25 -0
  31. data/templates/Debian-6.0.6-i386-netboot/virtualbox.sh +13 -0
  32. data/templates/Debian-6.0.6-i386-netboot/zerodisk.sh +3 -0
  33. data/templates/Debian-7.0-b2-i386-netboot/base.sh +27 -0
  34. data/templates/Debian-7.0-b2-i386-netboot/chef.sh +2 -0
  35. data/templates/Debian-7.0-b2-i386-netboot/cleanup-virtualbox.sh +4 -0
  36. data/templates/Debian-7.0-b2-i386-netboot/cleanup.sh +17 -0
  37. data/templates/Debian-7.0-b2-i386-netboot/definition.rb +51 -0
  38. data/templates/Debian-7.0-b2-i386-netboot/preseed.cfg +315 -0
  39. data/templates/Debian-7.0-b2-i386-netboot/puppet.sh +2 -0
  40. data/templates/Debian-7.0-b2-i386-netboot/ruby.sh +10 -0
  41. data/templates/Debian-7.0-b2-i386-netboot/vagrant.sh +25 -0
  42. data/templates/Debian-7.0-b2-i386-netboot/virtualbox.sh +13 -0
  43. data/templates/Debian-7.0-b2-i386-netboot/zerodisk.sh +3 -0
  44. data/templates/Fedora-17-i386/ks.cfg +4 -0
  45. data/templates/Fedora-17-x86_64/ks.cfg +4 -0
  46. data/templates/freebsd-9.0-RELEASE-amd64/definition.rb +19 -0
  47. data/templates/freebsd-9.0-RELEASE-amd64/postinstall.sh +93 -0
  48. data/templates/ubuntu-12.04.1-server-amd64/definition.rb +1 -1
  49. data/templates/ubuntu-12.10-server-amd64-packages/definition.rb +35 -0
  50. data/templates/ubuntu-12.10-server-amd64-packages/postinstall.sh +75 -0
  51. data/templates/ubuntu-12.10-server-amd64-packages/preseed.cfg +87 -0
  52. data/templates/ubuntu-12.10-server-amd64/definition.rb +35 -0
  53. data/templates/ubuntu-12.10-server-amd64/postinstall.sh +97 -0
  54. data/templates/ubuntu-12.10-server-amd64/preseed.cfg +87 -0
  55. data/templates/ubuntu-12.10-server-i386-packages/definition.rb +35 -0
  56. data/templates/ubuntu-12.10-server-i386-packages/postinstall.sh +75 -0
  57. data/templates/ubuntu-12.10-server-i386-packages/preseed.cfg +87 -0
  58. data/templates/ubuntu-12.10-server-i386/definition.rb +35 -0
  59. data/templates/ubuntu-12.10-server-i386/postinstall.sh +98 -0
  60. data/templates/ubuntu-12.10-server-i386/preseed.cfg +87 -0
  61. data/test/veewee/provider/virtualbox/box/helper/guest_additions_test.rb +95 -0
  62. data/test/veewee/provider/virtualbox/box/helper/version.rb +67 -0
  63. data/validation/features/steps/veewee_steps.rb +1 -1
  64. metadata +54 -4
@@ -0,0 +1,2 @@
1
+ # Install Puppet
2
+ gem install puppet --no-ri --no-rdoc
@@ -0,0 +1,10 @@
1
+ # Install Ruby from packages
2
+ apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc
3
+
4
+ # Install Rubygems from source
5
+ rg_ver=1.8.22
6
+ curl -o /tmp/rubygems-${rg_ver}.zip \
7
+ "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip"
8
+ (cd /tmp && unzip rubygems-${rg_ver}.zip && \
9
+ cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable)
10
+ rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip
@@ -0,0 +1,25 @@
1
+ # Set up Vagrant.
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Add groups puppet and chef
6
+ groupadd puppet
7
+ groupadd chef
8
+
9
+ # Create the user vagrant with password vagrant
10
+ useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant
11
+
12
+ # Install vagrant keys
13
+ mkdir -pm 700 /home/vagrant/.ssh
14
+ curl -Lo /home/vagrant/.ssh/authorized_keys \
15
+ 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
16
+ chmod 0600 /home/vagrant/.ssh/authorized_keys
17
+ chown -R vagrant:vagrant /home/vagrant/.ssh
18
+
19
+ # Customize the message of the day
20
+ echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd
21
+
22
+ # Install NFS client
23
+ apt-get -y install nfs-common
24
+
25
+
@@ -0,0 +1,13 @@
1
+ if test -f .vbox_version ; then
2
+ # The netboot installs the VirtualBox support (old) so we have to remove it
3
+ /etc/init.d/virtualbox-ose-guest-utils stop
4
+ rmmod vboxguest
5
+ aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils
6
+
7
+ # Install the VirtualBox guest additions
8
+ VBOX_VERSION=$(cat .vbox_version)
9
+ VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso
10
+ mount -o loop $VBOX_ISO /mnt
11
+ yes|sh /mnt/VBoxLinuxAdditions.run
12
+ umount /mnt
13
+ fi
@@ -0,0 +1,3 @@
1
+ # Zero out the free space to save space in the final image:
2
+ dd if=/dev/zero of=/EMPTY bs=1M
3
+ rm -f /EMPTY
@@ -12,6 +12,10 @@ rootpw --iscrypted $6$n/NGsk5H2aiBMXL4$r/oPkJtB5rasvQHPo9AvIJBe6sNVlQbpZxvTRMN7
12
12
  selinux --enforcing
13
13
  authconfig --enableshadow --passalgo=sha512
14
14
  firewall --service=ssh
15
+
16
+ # Avoiding warning message on Storage device breaking automated generation
17
+ zerombr
18
+
15
19
  # The following is the partition information you requested
16
20
  # Note that any partitions you deleted are not expressed
17
21
  # here so unless you clear all partitions first, this is
@@ -12,6 +12,10 @@ rootpw --iscrypted $6$n/NGsk5H2aiBMXL4$r/oPkJtB5rasvQHPo9AvIJBe6sNVlQbpZxvTRMN7
12
12
  selinux --enforcing
13
13
  authconfig --enableshadow --passalgo=sha512
14
14
  firewall --service=ssh
15
+
16
+ # Avoiding warning message on Storage device breaking automated generation
17
+ zerombr
18
+
15
19
  # The following is the partition information you requested
16
20
  # Note that any partitions you deleted are not expressed
17
21
  # here so unless you clear all partitions first, this is
@@ -0,0 +1,19 @@
1
+ Veewee::Definition.declare({
2
+ :cpu_count => '1', :memory_size=> '256',
3
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
4
+ :os_type_id => 'FreeBSD_64',
5
+ :iso_file => "mfsbsd-9.0-RELEASE-amd64.iso",
6
+ :iso_src => "http://mfsbsd.vx.sk/files/iso/mfsbsd-9.0-RELEASE-amd64.iso",
7
+ :iso_md5 => "a8aaac460d30f80fce2c6a96e0837db6",
8
+ :iso_download_timeout => "1000",
9
+ :boot_wait => "10", :boot_cmd_sequence => [
10
+ '<Enter>'
11
+ ],
12
+ :kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "",
13
+ :ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "mfsroot", :ssh_key => "",
14
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
15
+ :sudo_cmd => "sh '%f'",
16
+ :shutdown_cmd => "shutdown -H",
17
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
18
+ })
19
+ #'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
@@ -0,0 +1,93 @@
1
+ date > /etc/vagrant_box_build_time
2
+
3
+ # Get the latest portstree (needed for virtualbox to be on 4.x)
4
+ portsnap fetch update
5
+
6
+ #First install sudo
7
+ cd /usr/ports/security/sudo
8
+ make install -DBATCH
9
+
10
+ #We prefer bash to be there
11
+ cd /usr/ports/shells/bash
12
+ make install -DBATCH
13
+
14
+
15
+ #Off to rubygems to get first ruby running
16
+ cd /usr/ports/devel/ruby-gems
17
+ make install -DBATCH
18
+
19
+ #Gem chef - does install chef 9.12 (latest in ports?)
20
+ #cd /usr/ports/sysutils/rubygem-chef
21
+ #make install -DBATCH
22
+
23
+ #Installing chef & Puppet
24
+ #/usr/local/bin/gem update chef --no-ri --no-rdoc
25
+ /usr/local/bin/gem install puppet --no-ri --no-rdoc
26
+
27
+ #Get wget
28
+ cd /usr/ports/ftp/wget
29
+ make install -DBATCH
30
+
31
+ #Installing vagrant keys
32
+ mkdir /home/vagrant/.ssh
33
+ chmod 700 /home/vagrant/.ssh
34
+ cd /home/vagrant/.ssh
35
+ /usr/local/bin/wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
36
+ chown -R vagrant /home/vagrant/.ssh
37
+
38
+ # Cleaning portstree to save space
39
+ # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
40
+ cd /usr/ports/ports-mgmt/portupgrade
41
+ make install -DBATCH clean
42
+
43
+ /usr/local/sbin/portsclean -C
44
+
45
+ # As sharedfolders are not in defaults ports tree
46
+ # We will use vagrant via NFS
47
+ # Enable NFS
48
+ echo 'rpcbind_enable="YES"' >> /etc/rc.conf
49
+ echo 'nfs_server_enable="YES"' >> /etc/rc.conf
50
+ echo 'mountd_flags="-r"' >> /etc/rc.conf
51
+
52
+ # Enable passwordless sudo
53
+ echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers
54
+ # Restore correct su permissions
55
+ # I'll leave that up to the reader :)
56
+
57
+ echo "=============================================================================="
58
+ echo "NOTE: FreeBSD - Vagrant"
59
+ echo "When using this basebox you need to do some special stuff in your Vagrantfile"
60
+ echo "1) Include the correct system"
61
+ echo " require 'vagrant/systems/freebsd' "
62
+ echo "2) Add after your config.vm.box = ..."
63
+ echo " config.vm.system = :freebsd"
64
+ echo "3) Enable HostOnly network"
65
+ echo " config.vm.network ...."
66
+ echo "4) Use nfs instead of shared folders"
67
+ echo " :nfs => true"
68
+ echo "============================================================================="
69
+
70
+
71
+
72
+ exit
73
+
74
+ # The iso from virtualbox will only install windows/solaris or linux, no BSD
75
+ # Research is on it's way to have 4.x in the main portstree
76
+ # http://www.listware.net/201102/freebsd-ports/65201-call-for-testers-virtualbox-404.html
77
+ # Virtualbox additions - http://wiki.freebsd.org/VirtualBox
78
+ # Currently this will only work for 4.0.4
79
+ #cd /tmp
80
+ #wget http://home.bluelife.at/ports/virtualbox-cft-20110218.tar.gz
81
+ #cd /usr/ports
82
+ #tar -xzvf /tmp/virtualbox-cft-20110218.tar.gz
83
+
84
+ # This requires libtool >= 2.4
85
+ cd /usr/ports/devel/libtool
86
+ make clean
87
+ make install -DBATCH
88
+
89
+ cd /usr/ports/emulators/virtualbox-ose-additions
90
+ make install -DBATCH
91
+
92
+ echo 'vboxguest_enable="YES"' >> /etc/rc.conf
93
+ echo 'vboxservice_enable="YES"' >> /etc/rc.conf
@@ -16,7 +16,7 @@ Veewee::Session.declare({
16
16
  'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
17
  'hostname=%NAME% ',
18
18
  'fb=false debconf/frontend=noninteractive ',
19
- 'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
19
+ 'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
20
20
  'initrd=/install/initrd.gz -- <Enter>'
21
21
  ],
22
22
  :kickstart_port => "7122",
@@ -0,0 +1,35 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size=> '2048',
4
+ :disk_size => '10140',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Ubuntu_64',
8
+ :iso_file => "ubuntu-12.10-server-amd64.iso",
9
+ :iso_src => "http://releases.ubuntu.com/12.10/ubuntu-12.10-server-amd64.iso",
10
+ :iso_md5 => '4bd3270bde86d7e4e017e3847a4af485',
11
+ :iso_download_timeout => "1000",
12
+ :boot_wait => "4",
13
+ :boot_cmd_sequence => [
14
+ '<Esc><Esc><Enter>',
15
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
+ 'hostname=%NAME% ',
18
+ 'fb=false debconf/frontend=noninteractive ',
19
+ 'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=us keyboard-configuration/variant=us console-setup/ask_detect=false ',
20
+ 'initrd=/install/initrd.gz -- <Enter>'
21
+ ],
22
+ :kickstart_port => "7122",
23
+ :kickstart_timeout => "10000",
24
+ :kickstart_file => "preseed.cfg",
25
+ :ssh_login_timeout => "10000",
26
+ :ssh_user => "vagrant",
27
+ :ssh_password => "vagrant",
28
+ :ssh_key => "",
29
+ :ssh_host_port => "7222",
30
+ :ssh_guest_port => "22",
31
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32
+ :shutdown_cmd => "shutdown -P now",
33
+ :postinstall_files => [ "postinstall.sh"],
34
+ :postinstall_timeout => "10000"
35
+ })
@@ -0,0 +1,75 @@
1
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Apt-install various things necessary for Ruby, guest additions,
6
+ # etc., and remove optional things to trim down the machine.
7
+ apt-get -y update
8
+ apt-get -y upgrade
9
+ apt-get -y install linux-headers-$(uname -r) build-essential
10
+ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
11
+ apt-get -y install vim
12
+ apt-get clean
13
+
14
+ # Installing the virtualbox guest additions
15
+ apt-get -y install dkms
16
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
17
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
18
+ sh /mnt/VBoxLinuxAdditions.run
19
+ umount /mnt
20
+
21
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
22
+
23
+ cd /tmp
24
+
25
+ # Setup sudo to allow no-password sudo for "admin"
26
+ groupadd -r admin
27
+ usermod -a -G admin vagrant
28
+ cp /etc/sudoers /etc/sudoers.orig
29
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
30
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
31
+
32
+ # Add puppet group
33
+ groupadd -r puppet
34
+
35
+ # Install NFS client
36
+ apt-get -y install nfs-common
37
+
38
+ # Install Ruby from packages
39
+ apt-get -y install ruby rubygems ruby-dev
40
+
41
+ # Installing chef & Puppet
42
+ gem install chef --no-ri --no-rdoc
43
+ gem install puppet --no-ri --no-rdoc
44
+
45
+ # Installing vagrant keys
46
+ mkdir /home/vagrant/.ssh
47
+ chmod 700 /home/vagrant/.ssh
48
+ cd /home/vagrant/.ssh
49
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
50
+ chmod 600 /home/vagrant/.ssh/authorized_keys
51
+ chown -R vagrant /home/vagrant/.ssh
52
+
53
+ # Remove items used for building, since they aren't needed anymore
54
+ apt-get -y remove linux-headers-$(uname -r) build-essential
55
+ apt-get -y autoremove
56
+
57
+ # Zero out the free space to save space in the final image:
58
+ dd if=/dev/zero of=/EMPTY bs=1M
59
+ rm -f /EMPTY
60
+
61
+ # Removing leftover leases and persistent rules
62
+ echo "cleaning up dhcp leases"
63
+ rm /var/lib/dhcp3/*
64
+
65
+ # Make sure Udev doesn't block our network
66
+ # http://6.ptmc.org/?p=164
67
+ echo "cleaning up udev rules"
68
+ rm /etc/udev/rules.d/70-persistent-net.rules
69
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
70
+ rm -rf /dev/.udev/
71
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
72
+
73
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
74
+ echo "pre-up sleep 2" >> /etc/network/interfaces
75
+ exit
@@ -0,0 +1,87 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US.utf8
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string us
5
+
6
+ #d-i netcfg/get_hostname string dummy
7
+ d-i netcfg/get_hostname string unassigned-hostname
8
+ d-i netcfg/get_domain string unassigned-domain
9
+
10
+ # Continue without a default route
11
+ # Not working , specify a dummy in the DHCP
12
+ #d-i netcfg/no_default_route boolean
13
+
14
+ d-i time/zone string UTC
15
+ d-i clock-setup/utc-auto boolean true
16
+ d-i clock-setup/utc boolean true
17
+
18
+ d-i kbd-chooser/method select American English
19
+
20
+ d-i netcfg/wireless_wep string
21
+
22
+ d-i base-installer/kernel/override-image string linux-server
23
+ #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
+
25
+ # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
+ d-i debconf debconf/frontend select Noninteractive
27
+
28
+ d-i pkgsel/install-language-support boolean false
29
+ tasksel tasksel/first multiselect standard, ubuntu-server
30
+
31
+ #d-i partman-auto/method string regular
32
+ d-i partman-auto/method string lvm
33
+ #d-i partman-auto/purge_lvm_from_device boolean true
34
+
35
+ d-i partman-lvm/confirm boolean true
36
+ d-i partman-lvm/device_remove_lvm boolean true
37
+ d-i partman-auto/choose_recipe select atomic
38
+
39
+ d-i partman/confirm_write_new_label boolean true
40
+ d-i partman/confirm_nooverwrite boolean true
41
+ d-i partman/choose_partition select finish
42
+ d-i partman/confirm boolean true
43
+
44
+ #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
+ #Message: "write the changes to disk and configure lvm preseed"
46
+ #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
+ #preseed partman-lvm/confirm_nooverwrite boolean true
48
+
49
+ # Write the changes to disks and configure LVM?
50
+ d-i partman-lvm/confirm boolean true
51
+ d-i partman-lvm/confirm_nooverwrite boolean true
52
+ d-i partman-auto-lvm/guided_size string max
53
+
54
+ ## Default user, we can get away with a recipe to change this
55
+ d-i passwd/user-fullname string vagrant
56
+ d-i passwd/username string vagrant
57
+ d-i passwd/user-password password vagrant
58
+ d-i passwd/user-password-again password vagrant
59
+ d-i user-setup/encrypt-home boolean false
60
+ d-i user-setup/allow-password-weak boolean true
61
+
62
+ ## minimum is puppet and ssh and ntp
63
+ # Individual additional packages to install
64
+ d-i pkgsel/include string openssh-server ntp
65
+
66
+ # Whether to upgrade packages after debootstrap.
67
+ # Allowed values: none, safe-upgrade, full-upgrade
68
+ d-i pkgsel/upgrade select full-upgrade
69
+
70
+ d-i grub-installer/only_debian boolean true
71
+ d-i grub-installer/with_other_os boolean true
72
+ d-i finish-install/reboot_in_progress note
73
+
74
+ #For the update
75
+ d-i pkgsel/update-policy select none
76
+
77
+ # debconf-get-selections --install
78
+ #Use mirror
79
+ #d-i apt-setup/use_mirror boolean true
80
+ #d-i mirror/country string manual
81
+ #choose-mirror-bin mirror/protocol string http
82
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
+ #choose-mirror-bin mirror/http/directory string /ubuntu
84
+ #choose-mirror-bin mirror/suite select maverick
85
+ #d-i debian-installer/allow_unauthenticated string true
86
+
87
+ choose-mirror-bin mirror/http/proxy string
@@ -0,0 +1,35 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size=> '2048',
4
+ :disk_size => '10140',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Ubuntu_64',
8
+ :iso_file => "ubuntu-12.10-server-amd64.iso",
9
+ :iso_src => "http://releases.ubuntu.com/12.10/ubuntu-12.10-server-amd64.iso",
10
+ :iso_md5 => '4bd3270bde86d7e4e017e3847a4af485',
11
+ :iso_download_timeout => "1000",
12
+ :boot_wait => "4",
13
+ :boot_cmd_sequence => [
14
+ '<Esc><Esc><Enter>',
15
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
+ 'hostname=%NAME% ',
18
+ 'fb=false debconf/frontend=noninteractive ',
19
+ 'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=us keyboard-configuration/variant=us console-setup/ask_detect=false ',
20
+ 'initrd=/install/initrd.gz -- <Enter>'
21
+ ],
22
+ :kickstart_port => "7122",
23
+ :kickstart_timeout => "10000",
24
+ :kickstart_file => "preseed.cfg",
25
+ :ssh_login_timeout => "10000",
26
+ :ssh_user => "vagrant",
27
+ :ssh_password => "vagrant",
28
+ :ssh_key => "",
29
+ :ssh_host_port => "7222",
30
+ :ssh_guest_port => "22",
31
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32
+ :shutdown_cmd => "shutdown -P now",
33
+ :postinstall_files => [ "postinstall.sh"],
34
+ :postinstall_timeout => "10000"
35
+ })
@@ -0,0 +1,97 @@
1
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Apt-install various things necessary for Ruby, guest additions,
6
+ # etc., and remove optional things to trim down the machine.
7
+ apt-get -y update
8
+ apt-get -y upgrade
9
+ apt-get -y install linux-headers-$(uname -r) build-essential
10
+ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
11
+ apt-get -y install vim
12
+ apt-get clean
13
+
14
+ # Installing the virtualbox guest additions
15
+ apt-get -y install dkms
16
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
17
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
18
+ sh /mnt/VBoxLinuxAdditions.run
19
+ umount /mnt
20
+
21
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
22
+
23
+ cd /tmp
24
+
25
+ # Setup sudo to allow no-password sudo for "admin"
26
+ groupadd -r admin
27
+ usermod -a -G admin vagrant
28
+ cp /etc/sudoers /etc/sudoers.orig
29
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
30
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
31
+
32
+ # Add puppet group
33
+ groupadd -r puppet
34
+
35
+ # Install NFS client
36
+ apt-get -y install nfs-common
37
+
38
+ # Install Ruby from source in /opt so that users of Vagrant
39
+ # can install their own Rubies using packages or however.
40
+ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz
41
+ tar xvzf ruby-1.9.3-p286.tar.gz
42
+ cd ruby-1.9.3-p286
43
+ ./configure --prefix=/opt/ruby
44
+ make
45
+ make install
46
+ cd ..
47
+ rm -rf ruby-1.9.3-p286
48
+ rm ruby-1.9.3-p286.tar.gz
49
+
50
+ # Install RubyGems 1.8.24
51
+ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
52
+ tar xzf rubygems-1.8.24.tgz
53
+ cd rubygems-1.8.24
54
+ /opt/ruby/bin/ruby setup.rb
55
+ cd ..
56
+ rm -rf rubygems-1.8.24
57
+ rm rubygems-1.8.24.tgz
58
+
59
+ # Installing chef & Puppet
60
+ /opt/ruby/bin/gem install chef --no-ri --no-rdoc
61
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
62
+
63
+ # Add /opt/ruby/bin to the global path as the last resort so
64
+ # Ruby, RubyGems, and Chef/Puppet are visible
65
+ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/vagrantruby.sh
66
+
67
+ # Installing vagrant keys
68
+ mkdir /home/vagrant/.ssh
69
+ chmod 700 /home/vagrant/.ssh
70
+ cd /home/vagrant/.ssh
71
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
72
+ chmod 600 /home/vagrant/.ssh/authorized_keys
73
+ chown -R vagrant /home/vagrant/.ssh
74
+
75
+ # Remove items used for building, since they aren't needed anymore
76
+ apt-get -y remove linux-headers-$(uname -r) build-essential
77
+ apt-get -y autoremove
78
+
79
+ # Zero out the free space to save space in the final image:
80
+ dd if=/dev/zero of=/EMPTY bs=1M
81
+ rm -f /EMPTY
82
+
83
+ # Removing leftover leases and persistent rules
84
+ echo "cleaning up dhcp leases"
85
+ rm /var/lib/dhcp3/*
86
+
87
+ # Make sure Udev doesn't block our network
88
+ # http://6.ptmc.org/?p=164
89
+ echo "cleaning up udev rules"
90
+ rm /etc/udev/rules.d/70-persistent-net.rules
91
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
92
+ rm -rf /dev/.udev/
93
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
94
+
95
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
96
+ echo "pre-up sleep 2" >> /etc/network/interfaces
97
+ exit