veewee 0.1.29 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/Gemfile.lock +23 -29
  2. data/lib/veewee/session.rb +10 -7
  3. data/lib/veewee/ssh.rb +70 -42
  4. data/lib/veewee/version.rb +1 -1
  5. data/templates/CentOS-4.8-i386/postinstall.sh +2 -0
  6. data/templates/CentOS-5.6-i386-netboot/postinstall.sh +3 -1
  7. data/templates/CentOS-5.6-i386/postinstall.sh +3 -1
  8. data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +2 -0
  9. data/templates/CentOS-6.0-i386-netboot/definition.rb +16 -0
  10. data/templates/CentOS-6.0-i386-netboot/ks.cfg +52 -0
  11. data/templates/CentOS-6.0-i386-netboot/postinstall.sh +30 -0
  12. data/templates/CentOS-6.0-i386/definition.rb +17 -0
  13. data/templates/CentOS-6.0-i386/ks.cfg +47 -0
  14. data/templates/CentOS-6.0-i386/postinstall.sh +48 -0
  15. data/templates/CentOS-6.0-x86_64-netboot/definition.rb +16 -0
  16. data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +52 -0
  17. data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +30 -0
  18. data/templates/CentOS-6.0-x86_64/definition.rb +17 -0
  19. data/templates/CentOS-6.0-x86_64/ks.cfg +47 -0
  20. data/templates/CentOS-6.0-x86_64/postinstall.sh +48 -0
  21. data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +2 -0
  22. data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +2 -0
  23. data/templates/Debian-6.0.2-amd64-netboot/postinstall.sh +2 -0
  24. data/templates/Debian-6.0.2-i386-netboot/postinstall.sh +2 -0
  25. data/templates/Fedora-14-amd64-netboot/postinstall.sh +2 -0
  26. data/templates/Fedora-14-amd64/postinstall.sh +2 -0
  27. data/templates/Fedora-14-i386-netboot/postinstall.sh +2 -0
  28. data/templates/Fedora-14-i386/postinstall.sh +2 -0
  29. data/templates/Fedora-15-i386-netboot/definition.rb +17 -0
  30. data/templates/Fedora-15-i386-netboot/ks.cfg +82 -0
  31. data/templates/Fedora-15-i386-netboot/postinstall.sh +18 -0
  32. data/templates/Fedora-15-i386/definition.rb +17 -0
  33. data/templates/Fedora-15-i386/ks.cfg +64 -0
  34. data/templates/Fedora-15-i386/postinstall.sh +33 -0
  35. data/templates/archlinux-i386/aif.cfg +33 -0
  36. data/templates/archlinux-i386/definition.rb +29 -0
  37. data/templates/archlinux-i386/postinstall.sh +95 -0
  38. data/templates/archlinux-x86_64/aif.cfg +33 -0
  39. data/templates/{archlinux-64-aif-experimental → archlinux-x86_64}/definition.rb +7 -7
  40. data/templates/archlinux-x86_64/postinstall.sh +95 -0
  41. data/templates/freebsd-8.2-experimental/postinstall.sh +3 -1
  42. data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +2 -0
  43. data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +2 -0
  44. data/templates/gentoo-latest-i386-experimental/postinstall.sh +2 -0
  45. data/templates/openindiana-148-ai-x86/postinstall.sh +2 -0
  46. data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -0
  47. data/templates/solaris-11-express-i386/postinstall.sh +2 -0
  48. data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +4 -2
  49. data/templates/ubuntu-10.04.2-server-amd64-alt/definition.rb +57 -0
  50. data/templates/ubuntu-10.04.2-server-amd64-alt/postinstall.sh +249 -0
  51. data/templates/ubuntu-10.04.2-server-amd64-alt/preseed.cfg +124 -0
  52. data/templates/ubuntu-10.04.2-server-amd64/definition.rb +56 -23
  53. data/templates/ubuntu-10.04.2-server-amd64/postinstall.sh +4 -2
  54. data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +4 -2
  55. data/templates/ubuntu-10.04.2-server-i386/postinstall.sh +3 -1
  56. data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +4 -2
  57. data/templates/ubuntu-10.10-server-amd64/postinstall.sh +3 -1
  58. data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +4 -2
  59. data/templates/ubuntu-10.10-server-i386/postinstall.sh +4 -2
  60. data/templates/ubuntu-11.04-server-amd64/postinstall.sh +4 -2
  61. data/templates/ubuntu-11.04-server-i386/postinstall.sh +4 -2
  62. data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +2 -0
  63. data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +3 -1
  64. data/validation/features/steps/ssh_steps.rb +22 -8
  65. data/veewee.gemspec +2 -2
  66. metadata +40 -21
  67. data/templates/archlinux-64-aif-experimental/postinstall.sh +0 -6
  68. data/templates/archlinux-64-experimental/autorun0 +0 -6
  69. data/templates/archlinux-64-experimental/definition.rb +0 -21
  70. data/templates/archlinux-64-experimental/postinstall.sh +0 -190
  71. data/templates/archlinux-i686/autorun0 +0 -6
  72. data/templates/archlinux-i686/definition.rb +0 -21
  73. data/templates/archlinux-i686/postinstall.sh +0 -191
@@ -1,3 +1,5 @@
1
+ date > /etc/vagrant_box_build_time
2
+
1
3
  #http://www.freebsd.org/doc/en_US.ISO8859-1/articles/remote-install/installation.html
2
4
  dd if=/dev/zero of=/dev/ad4 count=2
3
5
  #bsdlabel -w -B /dev/ad4
@@ -186,4 +188,4 @@ load_rc_config "\$name"
186
188
  run_rc_command "\$1"
187
189
  EOF
188
190
 
189
- chmod 555 /mnt/usr/local/etc/rc.d/mkvirecover
191
+ chmod 555 /mnt/usr/local/etc/rc.d/mkvirecover
@@ -1,3 +1,5 @@
1
+ date > /etc/vagrant_box_build_time
2
+
1
3
  # Get the latest portstree (needed for virtualbox to be on 4.x)
2
4
  portsnap fetch update
3
5
 
@@ -1,3 +1,5 @@
1
+ date > /etc/vagrant_box_build_time
2
+
1
3
  # Get the latest portstree (needed for virtualbox to be on 4.x)
2
4
  portsnap fetch update
3
5
 
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ date > /etc/vagrant_box_build_time
4
+
3
5
  #Based on http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml
4
6
 
5
7
  #Partition the disk
@@ -1,5 +1,7 @@
1
1
  # http://projects.puppetlabs.com/projects/1/wiki/Puppet_Solaris
2
2
 
3
+ date > /etc/vagrant_box_build_time
4
+
3
5
  # Add the opencsw package site
4
6
  export PATH=/usr/bin:/usr/sbin:$PATH
5
7
 
@@ -1,5 +1,6 @@
1
1
  #Inspired by https://github.com/fnichol/wiki-notes/wiki/Creating-An-openSUSE-11.3-x32-Vagrant-Box
2
2
 
3
+ date > /etc/vagrant_box_build_time
3
4
 
4
5
  zypper --non-interactive refresh
5
6
  # zypper --non-interactive up
@@ -1,5 +1,7 @@
1
1
  # http://projects.puppetlabs.com/projects/1/wiki/Puppet_Solaris
2
2
 
3
+ date > /etc/vagrant_box_build_time
4
+
3
5
  # Add the opencsw package site
4
6
  export PATH=/usr/bin:/usr/sbin:$PATH
5
7
 
@@ -1,5 +1,7 @@
1
1
  # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
2
 
3
+ date > /etc/vagrant_box_build_time
4
+
3
5
  # Apt-install various things necessary for Ruby, guest additions,
4
6
  # etc., and remove optional things to trim down the machine.
5
7
  apt-get -y update
@@ -21,7 +23,7 @@ apt-get -y install nfs-common
21
23
  # We must install the 1.8.x series since Puppet doesn't support
22
24
  # Ruby 1.9 yet.
23
25
  wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz
24
- tar xvzf http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz
26
+ tar xvzf ruby-1.8.7-p334.tar.gz
25
27
  cd ruby-1.8.7-p334
26
28
  ./configure --prefix=/opt/ruby
27
29
  make
@@ -85,4 +87,4 @@ rm /lib/udev/rules.d/75-persistent-net-generator.rules
85
87
 
86
88
  echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
87
89
  echo "pre-up sleep 2" >> /etc/network/interfaces
88
- exit
90
+ exit
@@ -0,0 +1,57 @@
1
+ require 'digest/md5'
2
+ CURRENT_DIR = File.dirname(__FILE__)
3
+ PRESEED_MD5 = "#{Digest::MD5.file("#{CURRENT_DIR}/preseed.cfg").hexdigest}"
4
+ #ISO_MD5 = "#{Digest::MD5.file("#{CURRENT_DIR}/../../iso/ubuntu-10.04.2-alternate-amd64.iso").hexdigest}"
5
+
6
+ Veewee::Session.declare( {
7
+ :boot_cmd_sequence => [
8
+ "<Esc><Esc><Enter>",
9
+ "/install/vmlinuz ",
10
+ "noapic ",
11
+ "auto-install/enable",
12
+ "console-setup/ask_detect=false ",
13
+ "console-setup/modelcode=pc105 ",
14
+ "console-setup/layoutcode=us ",
15
+ "debconf/priority=critical ",
16
+ "debconf/frontend=noninteractive ",
17
+ "debian-installer=en_US ",
18
+ "debian-installer/locale=en_US ",
19
+ "debian-installer/framebuffer=false ",
20
+ "initrd=/install/initrd.gz ",
21
+ "kbd-chooser/method=us ",
22
+ "netcfg/get_hostname=%NAME% ",
23
+ "netcfg/dhcp_timeout=60 ",
24
+ "netcfg/choose_interface=auto ",
25
+ "preseed/interactive=false ",
26
+ "preseed/url=http://%IP%:%PORT%/preseed.cfg ",
27
+ "preseed/url/checksum=#{PRESEED_MD5} ",
28
+ "DEBCONF_DEBUG=5 ",
29
+ "-- <Enter>"
30
+ ],
31
+ :boot_wait => "10",
32
+ :cpu_count => '4',
33
+ :disk_size => '10140',
34
+ :disk_format => 'VMDK',
35
+ :hostiocache => 'on',
36
+ :iso_download_timeout => "60",
37
+ :iso_file => "ubuntu-10.04.2-alternate-amd64.iso",
38
+ :iso_src => "http://releases.ubuntu.com/10.04.2/ubuntu-10.04.2-alternate-amd64.iso",
39
+ :iso_md5 => "21929bb7caebcc600d92adb3e95a1229",
40
+ :kickstart_file => "preseed.cfg",
41
+ :kickstart_port => "7122",
42
+ :kickstart_timeout => "60",
43
+ :memory_size => '4096',
44
+ :os_type_id => 'Ubuntu_64',
45
+ :postinstall_files => [ "postinstall.sh" ],
46
+ :postinstall_timeout => "10000",
47
+ :ssh_guest_port => "22",
48
+ :ssh_host_port => "7222",
49
+ :ssh_key => "",
50
+ :ssh_login_timeout => "60",
51
+ :ssh_password => "vagrant",
52
+ :ssh_user => "vagrant",
53
+ :sudo_cmd => "echo '%p'|sudo -S bash '%f'",
54
+ :shutdown_cmd => "shutdown -h now",
55
+ :use_hw_virt_ext => 'off',
56
+ :use_pae => 'on'
57
+ })
@@ -0,0 +1,249 @@
1
+ #!/bin/bash
2
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
3
+ # Extended by hedgehog consistent with the designation - alternate
4
+ # Provides:
5
+ # - 1.9.2-p180 (system installed as root, managed via update-alternatives)
6
+ # - 1.8.7-p352 (system installed as root, managed via update-alternatives)
7
+ # - 1.9.2-p180 (user installed as $VEEWEE_USER, managed via rvm)
8
+ #
9
+ # NOTES:
10
+ # - package update and upgrade are done in the preseed.cfg via the late_command
11
+ #
12
+
13
+ date > /etc/vagrant_box_build_time
14
+
15
+ set -x
16
+ #set -e
17
+
18
+ export DEBIAN_FRONTEND=noninteractive
19
+ export VEEWEE_USER="vagrant"
20
+ export VBOX_VERSION=$(cat /home/${VEEWEE_USER}/.vbox_version)
21
+
22
+ ### Install packages
23
+ #
24
+ # Necessary for full Ruby 1.9.2, guest additions etc.
25
+ # Remove optional packages to trim VM size.
26
+ aptitude -y install python-software-properties
27
+ add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
28
+ apt-add-repository ppa:git-core/ppa
29
+ add-apt-repository ppa:byobu
30
+ aptitude -y purge apparmor apparmor-utils
31
+ aptitude -y install byobu \
32
+ git-core
33
+
34
+
35
+ ### Setup sudo
36
+ # Allow no-password sudo for "admin"
37
+ cp --archive /etc/sudoers /etc/sudoers.orig
38
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
39
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
40
+
41
+ ### Install NFS client
42
+ #
43
+ # This is likely a Vagrant specific package so we keep it separated.
44
+ apt-get -y install nfs-common
45
+
46
+ ### Install ruby 1.9.2-p180 from source
47
+ #
48
+ # Puppet 2.7 now supports 1.9.2
49
+ #
50
+ export RUBY_ROOT=/usr/bin/ruby
51
+ export RUBY_VER=1.9.2
52
+ export RUBY_BUILD_VER=${RUBY_VER}-p180
53
+
54
+ ##########################################
55
+ #
56
+ # ENSURE System RUBY and RUBYGEM, etc variables point to non version paths
57
+ #
58
+ ##########################################
59
+
60
+ cd /usr/local/src
61
+ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${RUBY_BUILD_VER}.tar.gz
62
+ tar -xzf ruby-${RUBY_BUILD_VER}.tar.gz
63
+ cd ruby-${RUBY_BUILD_VER}
64
+ ./configure --with-ruby-version=$RUBY_BUILD_VER --prefix=/usr --program-suffix=$RUBY_BUILD_VER
65
+ /usr/bin/make
66
+ /usr/bin/make install
67
+ cd ..
68
+ rm -rf ./ruby-${RUBY_BUILD_VER}/
69
+ rm ruby-${RUBY_BUILD_VER}.tar.gz
70
+ echo 'gem: --no-ri --no-rdoc' >>~/.gemrc
71
+
72
+ DIR_PATH=`readlink -f "/usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin"` # get rid of symlinks and get abs path
73
+ if test ! -d "${DIR_PATH}" ; then # now you're testing
74
+ mkdir -p /usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin
75
+ fi
76
+ RUBY_PRIORITY=`echo -n ${RUBY_VER}|sed -e 's/\.//g'`
77
+ update-alternatives \
78
+ --install ${RUBY_ROOT} ruby ${RUBY_ROOT}${RUBY_BUILD_VER} ${RUBY_PRIORITY} \
79
+ --slave /usr/bin/ri ri /usr/bin/ri${RUBY_BUILD_VER} \
80
+ --slave /usr/bin/erb erb /usr/bin/erb${RUBY_BUILD_VER} \
81
+ --slave /usr/bin/rake rake /usr/bin/rake${RUBY_BUILD_VER} \
82
+ --slave /usr/bin/rdoc rdoc /usr/bin/rdoc${RUBY_BUILD_VER} \
83
+ --slave /usr/bin/gem gem /usr/bin/gem${RUBY_BUILD_VER} \
84
+ --slave /usr/bin/testrb testrb /usr/bin/testrb${RUBY_BUILD_VER} \
85
+ --slave /usr/bin/irb irb /usr/bin/irb${RUBY_BUILD_VER} \
86
+ --slave /usr/lib/ruby/gems/bin gem-bin /usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin \
87
+ --slave /usr/share/man/man1/ruby.1 ruby.1 \
88
+ /usr/share/man/man1/ruby${RUBY_BUILD_VER}.1 \
89
+ --slave /usr/share/man/man1/erb.1 erb.1 \
90
+ /usr/share/man/man1/erb${RUBY_BUILD_VER}.1 \
91
+ --slave /usr/share/man/man1/irb.1 irb.1 \
92
+ /usr/share/man/man1/irb${RUBY_BUILD_VER}.1 \
93
+ --slave /usr/share/man/man1/ri.1 ri.1 \
94
+ /usr/share/man/man1/ri${RUBY_BUILD_VER}.1 \
95
+ --slave /usr/share/man/man1/rake.1 rake.1 \
96
+ /usr/share/man/man1/rake${RUBY_BUILD_VER}.1
97
+
98
+ ### Update PATH
99
+ #
100
+ # Make binaries from gems installed to system Ruby(above) available system wide
101
+ #
102
+ echo PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/ruby/gems/bin" >>/etc/environment
103
+ /usr/bin/gem update --system
104
+
105
+ ### Install Chef & Puppet
106
+ #
107
+ /usr/bin/gem install chef --no-ri --no-rdoc
108
+ /usr/bin/gem install puppet --no-ri --no-rdoc
109
+
110
+ ### Install Ruby 1.8.7
111
+ #
112
+ export RUBY_ROOT=/usr/bin/ruby
113
+ export RUBY_VER=1.8.7
114
+ export RUBY_BUILD_VER=${RUBY_VER}-p352
115
+
116
+ wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-${RUBY_BUILD_VER}.tar.gz
117
+ tar -xzf ruby-${RUBY_BUILD_VER}.tar.gz
118
+ cd ruby-${RUBY_BUILD_VER}
119
+ ./configure --with-ruby-version=$RUBY_BUILD_VER --prefix=/usr --program-suffix=$RUBY_BUILD_VER
120
+ /usr/bin/make
121
+ /usr/bin/make install
122
+ cd ..
123
+ rm -rf ruby-${RUBY_BUILD_VER}
124
+ rm ruby-${RUBY_BUILD_VER}.tar.gz
125
+
126
+ ### Install RubyGems 1.8.5
127
+ #
128
+ wget http://rubyforge.org/frs/download.php/74954/rubygems-1.8.5.tgz
129
+ tar -xzf rubygems-1.8.5.tgz
130
+ cd rubygems-1.8.5
131
+ /usr/bin/ruby${RUBY_BUILD_VER} setup.rb --format-executable
132
+ cd ..
133
+ rm -rf rubygems-1.8.5
134
+ rm rubygems-1.8.5.tgz
135
+
136
+ DIR_PATH=`/bin/readlink -f "/usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin"` # get rid of symlinks and get abs path
137
+ if test ! -d "${DIR_PATH}" || -n "${DIR_PATH}" ; then # now you're testing
138
+ mkdir -p /usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin
139
+ fi
140
+ RUBY_PRIORITY=`echo -n ${RUBY_VER}|sed -e 's/\.//g'`
141
+ update-alternatives \
142
+ --install ${RUBY_ROOT} ruby ${RUBY_ROOT}${RUBY_BUILD_VER} ${RUBY_PRIORITY} \
143
+ --slave /usr/bin/ri ri /usr/bin/ri${RUBY_BUILD_VER} \
144
+ --slave /usr/bin/erb erb /usr/bin/erb${RUBY_BUILD_VER} \
145
+ --slave /usr/bin/rdoc rdoc /usr/bin/rdoc${RUBY_BUILD_VER} \
146
+ --slave /usr/bin/gem gem /usr/bin/gem${RUBY_BUILD_VER} \
147
+ --slave /usr/bin/irb irb /usr/bin/irb${RUBY_BUILD_VER} \
148
+ --slave /usr/bin/testrb testrb /usr/bin/testrb${RUBY_BUILD_VER} \
149
+ --slave /usr/lib/ruby/gems/bin gem-bin /usr/lib/ruby/gems/${RUBY_BUILD_VER}/bin \
150
+ --slave /usr/share/man/man1/ruby.1 ruby.1 \
151
+ /usr/share/man/man1/ruby${RUBY_BUILD_VER}.1 \
152
+
153
+ DIR_PATH=`readlink -f "/var/www"` # get rid of symlinks and get abs path
154
+ if test ! -d "${DIR_PATH}" ; then # now you're testing
155
+ mkdir -p $DIR_PATH
156
+ fi
157
+ chown ${VEEWEE_USER}:${VEEWEE_USER} /var/www
158
+
159
+ ### Install RVM
160
+ #
161
+ # Install 1.9.2-p180, under vagrant user account
162
+ # Set default RVM to the system Ruby 1.9.2 installed above.
163
+ cat <<'EOP' > /tmp/install_rvm.sh
164
+ #!/bin/bash
165
+ set -x
166
+ bash < <(curl -sk https://rvm.beginrescueend.com/install/rvm)
167
+ #-C --with-openssl-dir=$rvm_usr_dir,--with-libyaml-dir=$rvm_usr_dir,--with-readline-dir=$rvm_usr_dir
168
+ echo 'test -s "$HOME/.rvm/scripts/rvm" && source "$HOME/.rvm/scripts/rvm" # Load RVM function' >> $HOME/.bashrc
169
+ echo 'test -r $rvm_path/scripts/completion && source $rvm_path/scripts/completion # Load RVM bash completion' >> $HOME/.bashrc
170
+ echo 'test -s "$HOME/.rvm/scripts/rvm" && source "$HOME/.rvm/scripts/rvm" # Load RVM function' >> $HOME/.profile
171
+ echo 'test -r $rvm_path/scripts/completion && source $rvm_path/scripts/completion # Load RVM bash completion' >> $HOME/.profile
172
+ source "$HOME/.rvm/scripts/rvm"
173
+ type rvm | head -1
174
+ rvm install ruby-1.9.2-p180
175
+ cat <<'RVMRC_CONTENTS' > $HOME/.rvmrc
176
+ rvm_install_on_use_flag=1
177
+ rvm_trust_rvmrcs_flag=1
178
+ rvm_gemset_create_on_use_flag=1
179
+ RVMRC_CONTENTS
180
+ EOP
181
+
182
+ chmod a+x /tmp/install_rvm.sh
183
+ su --login - $VEEWEE_USER -c '/tmp/install_rvm.sh'
184
+
185
+ ### Install Vagrant public key
186
+ #
187
+ DIR_PATH=`readlink -f "/home/${VEEWEE_USER}/.ssh"` # get rid of symlinks and get abs path
188
+ if test ! -d "${DIR_PATH}" ; then
189
+ mkdir -p /home/${VEEWEE_USER}/.ssh
190
+ fi
191
+ chmod 700 /home/${VEEWEE_USER}/.ssh
192
+ cd /home/${VEEWEE_USER}/.ssh
193
+ wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
194
+ chmod 0600 /home/${VEEWEE_USER}/.ssh/*
195
+ chown -R ${VEEWEE_USER} /home/${VEEWEE_USER}/.ssh
196
+ cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
197
+ chmod a-w /etc/ssh/sshd_config.original
198
+ echo PubkeyAuthentication yes >>/etc/ssh/sshd_config
199
+ echo RSAAuthentication yes >>/etc/ssh/sshd_config
200
+ echo PasswordAuthentication no >>/etc/ssh/sshd_config
201
+ echo ChallengeResponseAuthentication no >>/etc/ssh/sshd_config
202
+ /etc/init.d/ssh restart
203
+
204
+ ### Install Virtualbox guest additions
205
+ #
206
+ cd /tmp
207
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
208
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
209
+ sh /mnt/VBoxLinuxAdditions.run
210
+ umount /mnt
211
+
212
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
213
+
214
+ ### Package Cleanup
215
+ #
216
+ # Remove items that aren't needed anymore
217
+ apt-get -y autoremove
218
+ apt-get clean
219
+
220
+
221
+ ### Improve VM disk compression
222
+ #
223
+ # Zero out the free space to save space in the final image:
224
+ dd if=/dev/zero of=/EMPTY bs=1M
225
+ rm -f /EMPTY
226
+
227
+ ### Network fixes
228
+ #
229
+ # Removing leftover leases and persistent rules
230
+ echo "cleaning up dhcp leases"
231
+ rm /var/lib/dhcp3/*
232
+
233
+ # Make sure Udev doesn't block our network
234
+ # http://6.ptmc.org/?p=164
235
+ echo "cleaning up udev rules"
236
+ DIR_PATH=`readlink -f "/etc/udev/rules.d/70-persistent-net.rules"` # get rid of symlinks and get abs path
237
+ rm -rf /etc/udev/rules.d/70-persistent-net.rules
238
+ if test ! -d "${DIR_PATH}" ; then
239
+ mkdir -p /etc/udev/rules.d/70-persistent-net.rules
240
+ fi
241
+ rm -rf /dev/.udev/
242
+ rm -rf /lib/udev/rules.d/75-persistent-net-generator.rules
243
+
244
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
245
+ echo "pre-up sleep 2" >> /etc/network/interfaces
246
+
247
+ ### Exit
248
+ #
249
+ exit 0
@@ -0,0 +1,124 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string Belgium
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 Europe/Brussels
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 Belgian
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 acpid \
65
+ autoconf \
66
+ bison \
67
+ curl \
68
+ dkms \
69
+ gcc \
70
+ libbsd-dev \
71
+ libc6-dev \
72
+ libcurl4-openssl-dev \
73
+ libreadline6 \
74
+ libreadline6-dev \
75
+ libsqlite3-0 \
76
+ libsqlite3-dev \
77
+ libssl-dev \
78
+ libxml2 \
79
+ libxml2-dev \
80
+ libxslt-dev \
81
+ libxslt1-dev \
82
+ libyaml-dev \
83
+ ncurses-dev \
84
+ ntp \
85
+ openssh-server \
86
+ openssl \
87
+ readline-common \
88
+ rsyslog \
89
+ sqlite3 \
90
+ zlib1g \
91
+ zlib1g-dev
92
+
93
+ # Whether to upgrade packages after debootstrap.
94
+ # Allowed values: none, safe-upgrade, full-upgrade
95
+ d-i pkgsel/upgrade select full-upgrade
96
+
97
+ d-i grub-installer/only_debian boolean true
98
+ d-i grub-installer/with_other_os boolean true
99
+
100
+ #For the update
101
+ d-i pkgsel/update-policy select none
102
+
103
+ # debconf-get-selections --install
104
+ #Use mirror
105
+ #d-i apt-setup/use_mirror boolean true
106
+ #d-i mirror/country string manual
107
+ #choose-mirror-bin mirror/protocol string http
108
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
109
+ #choose-mirror-bin mirror/http/directory string /ubuntu
110
+ #choose-mirror-bin mirror/suite select maverick
111
+ #d-i debian-installer/allow_unauthenticated string true
112
+
113
+ choose-mirror-bin mirror/http/proxy string
114
+
115
+ # This command, and you can only have one, is run just before the install
116
+ # finishes, but when there is still a usable /target directory.
117
+ # You can chroot to /target and use it directly, or use the apt-install
118
+ # and in-target commands to easily install packages and run commands in
119
+ # the target system.
120
+ #
121
+ d-i preseed/late_command string in-target /usr/bin/aptitude -q -y update; in-target /usr/bin/aptitude -q -y safe-upgrade; in-target /usr/bin/aptitude -q -y clean;
122
+
123
+ # Avoid that last message about the install being complete.
124
+ d-i finish-install/reboot_in_progress note