veewee 0.1.8 → 0.1.9

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 (31) hide show
  1. data/Gemfile.lock +4 -4
  2. data/lib/veewee/command.rb +1 -1
  3. data/lib/veewee/session.rb +35 -15
  4. data/lib/veewee/transaction.rb +19 -10
  5. data/lib/veewee/version.rb +1 -1
  6. data/templates/Archlinux-experimental/autorun0 +6 -0
  7. data/templates/Archlinux-experimental/definition.rb +22 -0
  8. data/templates/Archlinux-experimental/postinstall.sh +184 -0
  9. data/templates/CentOS-4.8-i386/definition.rb +1 -1
  10. data/templates/CentOS-4.8-i386/postinstall.sh +2 -1
  11. data/templates/CentOS-5.5-i386-netboot/definition.rb +1 -1
  12. data/templates/CentOS-5.5-i386-netboot/postinstall.sh +2 -1
  13. data/templates/CentOS-5.5-i386/definition.rb +1 -1
  14. data/templates/CentOS-5.5-i386/postinstall.sh +2 -1
  15. data/templates/Sysrescuecd-2.0.0-experimental/autorun0 +1 -57
  16. data/templates/Sysrescuecd-2.0.0-experimental/definition.rb +2 -2
  17. data/templates/ubuntu-10.04.1-server-amd64/definition.rb +1 -1
  18. data/templates/ubuntu-10.04.1-server-amd64/postinstall.sh +2 -1
  19. data/templates/ubuntu-10.04.1-server-i386/definition.rb +1 -1
  20. data/templates/ubuntu-10.04.1-server-i386/postinstall.sh +2 -1
  21. data/templates/ubuntu-10.10-server-amd64-netboot/definition.rb +1 -1
  22. data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +2 -1
  23. data/templates/ubuntu-10.10-server-amd64-netboot/preseed.cfg +8 -6
  24. data/templates/ubuntu-10.10-server-amd64/definition.rb +1 -1
  25. data/templates/ubuntu-10.10-server-amd64/postinstall.sh +3 -2
  26. data/templates/ubuntu-10.10-server-i386-netboot/definition.rb +1 -1
  27. data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +2 -1
  28. data/templates/ubuntu-10.10-server-i386-netboot/preseed.cfg +8 -6
  29. data/templates/ubuntu-10.10-server-i386/definition.rb +1 -1
  30. data/templates/ubuntu-10.10-server-i386/postinstall.sh +2 -1
  31. metadata +7 -4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- veewee (0.1.8)
4
+ veewee (0.1.9)
5
5
  highline (~> 1.6.1)
6
6
  net-ssh (~> 2.1.0)
7
7
  popen4 (~> 0.1.2)
@@ -21,7 +21,7 @@ GEM
21
21
  rake (>= 0.8.7)
22
22
  highline (1.6.1)
23
23
  i18n (0.5.0)
24
- json (1.4.6)
24
+ json (1.5.1)
25
25
  mario (0.0.6)
26
26
  net-scp (1.0.4)
27
27
  net-ssh (>= 1.99.1)
@@ -33,11 +33,11 @@ GEM
33
33
  progressbar (0.9.0)
34
34
  rake (0.8.7)
35
35
  thor (0.14.6)
36
- vagrant (0.7.1)
36
+ vagrant (0.7.2)
37
37
  archive-tar-minitar (= 0.5.2)
38
38
  erubis (~> 2.6.6)
39
39
  i18n (~> 0.5.0)
40
- json (~> 1.4.6)
40
+ json (~> 1.5.1)
41
41
  mario (~> 0.0.6)
42
42
  net-scp (~> 1.0.4)
43
43
  net-ssh (~> 2.1.0)
@@ -52,7 +52,7 @@ class Command < Vagrant::Command::GroupBase
52
52
 
53
53
  desc "destroy BOXNAME", "Destroys the virtualmachine that was build for a basebox"
54
54
  def destroy(boxname)
55
- puts Veewee::Session.destroy_vm(boxname)
55
+ Veewee::Session.destroy_vm(boxname)
56
56
  end
57
57
 
58
58
  desc "list", "Lists all defined baseboxes"
@@ -262,7 +262,12 @@ module Veewee
262
262
  versionfile=Tempfile.open("vbox.version")
263
263
  versionfile.puts "#{VirtualBox::Global.global.lib.virtualbox.version}"
264
264
  versionfile.rewind
265
- Veewee::Ssh.transfer_file("localhost",versionfile.path,".vbox_version", ssh_options)
265
+ begin
266
+ Veewee::Ssh.transfer_file("localhost",versionfile.path,".vbox_version", ssh_options)
267
+ rescue RuntimeError
268
+ puts "error transfering file, possible not enough permissions to write?"
269
+ exit
270
+ end
266
271
  puts ""
267
272
  versionfile.close
268
273
  versionfile.delete
@@ -279,8 +284,12 @@ module Veewee
279
284
  transaction(boxname,"#{counter}-#{postinstall_file}-#{checksums[counter]}",checksums) do
280
285
 
281
286
  Veewee::Ssh.when_ssh_login_works("localhost",ssh_options) do
282
-
283
- Veewee::Ssh.transfer_file("localhost",filename,File.basename(filename),ssh_options)
287
+ begin
288
+ Veewee::Ssh.transfer_file("localhost",filename,File.basename(filename),ssh_options)
289
+ rescue RuntimeError
290
+ puts "error transfering file, possible not enough permissions to write?"
291
+ exit
292
+ end
284
293
  command=@definition[:sudo_cmd]
285
294
  command.gsub!(/%p/,"#{@definition[:ssh_password]}")
286
295
  command.gsub!(/%u/,"#{@definition[:ssh_user]}")
@@ -340,7 +349,7 @@ module Veewee
340
349
  def self.destroy_vm(boxname)
341
350
 
342
351
  load_definition(boxname)
343
-
352
+ @vboxcmd=determine_vboxcmd
344
353
  #:destroy_medium => :delete, will delete machine + all media attachments
345
354
  #vm.destroy(:destroy_medium => :delete)
346
355
  ##vm.destroy(:destroy_image => true)
@@ -357,12 +366,19 @@ module Veewee
357
366
  if (!vm.nil? && !(vm.powered_off?))
358
367
  puts "Shutting down vm #{boxname}"
359
368
  #We force it here, maybe vm.shutdown is cleaner
360
- vm.stop
369
+ begin
370
+ vm.stop
371
+ rescue VirtualBox::Exceptions::InvalidVMStateException
372
+ puts "There was problem sending the stop command because the machine is in an Invalid state"
373
+ puts "Please verify leftovers from a previous build in your vm folder"
374
+ exit
375
+ end
376
+ sleep 3
361
377
  end
362
- sleep 3
378
+
363
379
 
364
380
  command="#{@vboxcmd} unregistervm '#{boxname}' --delete"
365
-
381
+ puts command
366
382
  puts "Deleting vm #{boxname}"
367
383
 
368
384
  #Exec and system stop the execution here
@@ -381,14 +397,16 @@ module Veewee
381
397
  command="#{@vboxcmd} closemedium disk '#{d.location}'"
382
398
  end
383
399
 
384
- command="#{@vboxcmd} closemedium disk '#{d.location}' --delete"
400
+ #command="#{@vboxcmd} closemedium disk '#{d.location}' --delete"
385
401
  puts "Deleting disk #{d.location}"
386
402
  puts "#{command}"
387
403
 
388
404
  Veewee::Shell.execute("#{command}")
389
405
 
390
406
  if File.exists?(d.location)
391
- puts "We tried to delete the disk file '#{d.location} but failed"
407
+ puts "We tried to delete the disk file via virtualbox '#{d.location} but failed"
408
+ puts "Removing it manually"
409
+ FileUtils.rm(d.location)
392
410
  exit
393
411
  end
394
412
  #v.3
@@ -396,9 +414,6 @@ module Veewee
396
414
  break
397
415
  end
398
416
  end
399
-
400
-
401
-
402
417
  end
403
418
 
404
419
  def self.create_vm(boxname,force=false)
@@ -477,6 +492,8 @@ module Veewee
477
492
  end
478
493
  end
479
494
 
495
+ @vboxcmd=determine_vboxcmd
496
+
480
497
  if !found
481
498
  puts "Creating new harddrive of size #{@definition[:disk_size].to_i} "
482
499
 
@@ -489,12 +506,13 @@ module Veewee
489
506
  ##VirtualBox::Global.global.max_vdi_size=1000000
490
507
  #newdisk.save
491
508
 
492
- command="VBoxManage list systemproperties|grep '^Default machine'|cut -d ':' -f 2|sed -e 's/^[ ]*//'"
509
+ command="#{@vboxcmd} list systemproperties|grep '^Default machine'|cut -d ':' -f 2|sed -e 's/^[ ]*//'"
493
510
  results=IO.popen("#{command}")
494
511
  place=results.gets.chop
495
512
  results.close
496
513
 
497
514
  command ="#{@vboxcmd} createhd --filename '#{place}/#{boxname}/#{boxname}.#{@definition[:disk_format]}' --size '#{@definition[:disk_size].to_i}' --format #{@definition[:disk_format]} > /dev/null"
515
+ puts "#{command}"
498
516
  Veewee::Shell.execute("#{command}")
499
517
 
500
518
  end
@@ -516,8 +534,10 @@ module Veewee
516
534
 
517
535
  def self.attach_disk(boxname)
518
536
  location=boxname+"."+@definition[:disk_format].downcase
519
-
520
- command="VBoxManage list systemproperties|grep '^Default machine'|cut -d ':' -f 2|sed -e 's/^[ ]*//'"
537
+
538
+ @vboxcmd=determine_vboxcmd
539
+
540
+ command="#{@vboxcmd} list systemproperties|grep '^Default machine'|cut -d ':' -f 2|sed -e 's/^[ ]*//'"
521
541
  results=IO.popen("#{command}")
522
542
  place=results.gets.chop
523
543
  results.close
@@ -19,23 +19,29 @@ module Veewee
19
19
  end
20
20
 
21
21
  def self.remove_snapshot_vmachine(vmname,snapname)
22
- Veewee::Shell.execute("VBoxManage snapshot '#{vmname}' delete '#{snapname}'")
22
+ @vboxcmd=Veewee::Session.determine_vboxcmd
23
+
24
+ Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' delete '#{snapname}'")
23
25
  end
24
26
 
25
27
  def self.create_snapshot_vmachine(vmname,snapname)
26
- Veewee::Shell.execute("VBoxManage snapshot '#{vmname}' take '#{snapname}'")
28
+ @vboxcmd=Veewee::Session.determine_vboxcmd
29
+
30
+ Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' take '#{snapname}'")
27
31
  end
28
32
 
29
33
  def self.load_snapshot_vmachine(vmname,snapname)
34
+ @vboxcmd=Veewee::Session.determine_vboxcmd
35
+
30
36
  #if it running , shutdown first
31
37
  if (state_vmachine(vmname)=="running")
32
38
  stop_vmachine(vmname)
33
39
  end
34
40
 
35
- Veewee::Shell.execute("VBoxManage snapshot '#{vmname}' restore '#{snapname}'")
41
+ Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' restore '#{snapname}'")
36
42
  #sometimes it takes some time to shutdown
37
43
  sleep 2
38
- Veewee::Shell.execute("VBoxManage startvm '#{vmname}'")
44
+ Veewee::Shell.execute("#{@vboxcmd} startvm '#{vmname}'")
39
45
  end
40
46
 
41
47
  def self.snapshot_exists(vmname,snapname)
@@ -58,10 +64,11 @@ module Veewee
58
64
 
59
65
  def self.rollback_snapshot(vmname,snapname)
60
66
  delete_flag=false
67
+ @vboxcmd=Veewee::Session.determine_vboxcmd
61
68
 
62
69
  savestate_recover=false
63
70
  if (state_vmachine(vmname)=="running")
64
- Veewee::Shell.execute("VBoxManage controlvm '#{vmname}' savestate")
71
+ Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' savestate")
65
72
  savestate_recover=true
66
73
  end
67
74
 
@@ -77,7 +84,7 @@ module Veewee
77
84
 
78
85
  sleep 2
79
86
 
80
- Veewee::Shell.execute("VBoxManage startvm '#{vmname}'")
87
+ Veewee::Shell.execute("#{@vboxcmd} startvm '#{vmname}'")
81
88
 
82
89
  if (savestate_recover)
83
90
  #Recovering from savestate nukes the network! This trick seem to work
@@ -85,9 +92,9 @@ module Veewee
85
92
  #http://www.virtualbox.org/ticket/5666
86
93
  #http://www.virtualbox.org/ticket/5654
87
94
  #This is supposed to be fixed: http://www.virtualbox.org/changeset/25205 but alas
88
- Veewee::Shell.execute("VBoxManage controlvm '#{vmname}' nic1 nat")
89
- Veewee::Shell.execute("VBoxManage controlvm '#{vmname}' setlinkstate1 off")
90
- Veewee::Shell.execute("VBoxManage controlvm '#{vmname}' setlinkstate1 on")
95
+ Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' nic1 nat")
96
+ Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' setlinkstate1 off")
97
+ Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' setlinkstate1 on")
91
98
  sleep 2
92
99
 
93
100
  #hmmm, virtualbox => when recovering from a restore , it looses the nat settings!!! So we need to do this again!!
@@ -101,7 +108,9 @@ module Veewee
101
108
 
102
109
 
103
110
  def self.list_snapshots(vmname)
104
- snapshotresult=Veewee::Shell.execute("VBoxManage showvminfo --machinereadable '#{vmname}' |grep ^SnapshotName| cut -d '=' -f 2").stdout
111
+ @vboxcmd=Veewee::Session.determine_vboxcmd
112
+
113
+ snapshotresult=Veewee::Shell.execute("#{@vboxcmd} showvminfo --machinereadable '#{vmname}' |grep ^SnapshotName| cut -d '=' -f 2").stdout
105
114
  snapshotlist=snapshotresult.gsub(/\"/,'').split(/\n/)
106
115
  return snapshotlist
107
116
  end
@@ -1,3 +1,3 @@
1
1
  module Veewee
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ echo "We are installing archlinux through the livecd of System Rescue"
4
+ echo "Please wait while we do the grunt work ."
5
+
6
+ echo "Occassinally this hangs because of network issues to the archlinux mirrors"
@@ -0,0 +1,22 @@
1
+ Veewee::Session.declare( {
2
+ :cpu_count => '1', :memory_size=> '256',
3
+ :disk_size => '10140', :disk_format => 'VDI',:disk_size => '10240' ,
4
+ :os_type_id => 'Linux',
5
+ :iso_file => "systemrescuecd-x86-2.0.0.iso",
6
+ :iso_src => "http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.0.0/systemrescuecd-x86-2.0.0.iso?r=http%3A%2F%2Fwww.sysresccd.org%2FDownload&ts=1297107227&use_mirror=ignum",
7
+ :iso_md5 => "51012e0bb943cff6367e5cea3a61cdbe",
8
+ :iso_download_timeout => "1000",
9
+ :boot_wait => "10",:boot_cmd_sequence => [
10
+ '<Tab> ',
11
+ 'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
12
+ '<Enter>'
13
+ ],
14
+ :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "autorun0",
15
+ :ssh_login_timeout => "10000",:ssh_user => "root", :ssh_password => "vagrant",:ssh_key => "",
16
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
17
+ :sudo_cmd => "sh '%f'",
18
+ :shutdown_cmd => "shutdown -H",
19
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
20
+ }
21
+ )
22
+ #'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
@@ -0,0 +1,184 @@
1
+ #!/bin/bash
2
+
3
+ #https://wiki.archlinux.org/index.php/Install_from_Existing_Linux
4
+
5
+ ARCH=i686
6
+ mkdir /tmp/archlinux
7
+ cd /tmp/archlinux
8
+
9
+ alias wget='wget --trust-server-names'
10
+
11
+ wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/
12
+ wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/
13
+
14
+ wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/
15
+ wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/
16
+ wget http://www.archlinux.org/packages/core/$ARCH/bzip2/download/
17
+ wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/
18
+ wget http://www.archlinux.org/packages/core/$ARCH/xz/download/
19
+ wget http://www.archlinux.org/packages/core/$ARCH/expat/download/
20
+
21
+ for f in *.tar.xz ; do unxz -v $f ; done
22
+ for f in *.tar ; do tar xvf $f ; done
23
+ for f in *.tar.gz ; do tar xzvf $f ; done
24
+
25
+
26
+ export PATH=/tmp/archlinux/usr/bin:$PATH
27
+ export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:/tmp/archlinux/lib:$LD_LIBRARY_PATH
28
+ alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf"
29
+
30
+ cd /
31
+ for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do
32
+ tar xzf $f
33
+ done
34
+
35
+ #/etc/pacman.d/mirrorlist
36
+ #enable a mirror
37
+
38
+ #Partition the disk
39
+ #This assumes a predefined layout - customize to your own liking
40
+
41
+ sfdisk --force /dev/sda <<EOF
42
+ # partition table of /dev/sda
43
+ unit: sectors
44
+
45
+ /dev/sda1 : start= 2048, size= 18874368, Id=83
46
+ /dev/sda2 : start= 18876416, size= 2095104, Id=82
47
+ /dev/sda3 : start= 0, size= 0, Id= 0
48
+ /dev/sda4 : start= 0, size= 0, Id= 0
49
+ EOF
50
+
51
+ sleep 2
52
+
53
+ #Format the first disk
54
+ mkfs.ext3 /dev/sda1
55
+
56
+ #Format the swap and use it
57
+ mkswap /dev/sda2
58
+ swapon /dev/sda2
59
+
60
+ mkdir /newarch
61
+ mount /dev/sda1 /newarch
62
+
63
+ mkdir -p /newarch/var/lib/pacman
64
+
65
+ #setting pacman - mirror - Belgium
66
+ #Customize to your own liking
67
+ sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
68
+
69
+ # https://wiki.archlinux.org/index.php/Mirrors#List_by_speed
70
+ # pacman -S reflector
71
+ # export LC_ALL=C
72
+ # reflector -c Belgium -l 8 -r -o /etc/pacman.d/mirrorlist
73
+
74
+ pacman -Sy -r /newarch
75
+
76
+ #pacman: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
77
+ #require bzip2
78
+ pacman --noconfirm --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch
79
+
80
+ #Create the devices
81
+ cd /newarch/dev
82
+ rm -f console ; mknod -m 600 console c 5 1
83
+ rm -f null ; mknod -m 666 null c 1 3
84
+ rm -f zero ; mknod -m 666 zero c 1 5
85
+
86
+ #Copy the dns information (cp is aliased so we use the binary)
87
+ /bin/cp -f /etc/resolv.conf /newarch/etc/
88
+
89
+ #Mount the process architecture
90
+ mount -t proc proc /newarch/proc
91
+ mount -t sysfs sys /newarch/sys
92
+ mount -o bind /dev /newarch/dev
93
+
94
+ chroot /newarch pacman --noconfirm -S kernel26
95
+
96
+ #set the mirror list within the machine
97
+ chroot /newarch sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
98
+ #/etc/fstab
99
+ #We need a partition!
100
+
101
+ echo "echo '/dev/sda1 / ext4 defaults,noatime 0 0' >> /etc/fstab"|chroot /newarch sh -
102
+ echo "echo '/dev/sda2 swap swap defaults 0 0'>> /etc/fstab"|chroot /newarch sh -
103
+
104
+ #/etc/rc.conf
105
+
106
+ #hostname
107
+
108
+ chroot /newarch sed -i 's/^HOSTNAME=\(.*\)/HOSTNAME=vagrant-arch/' /etc/rc.conf
109
+ #gateway
110
+
111
+ #/etc/hosts
112
+ #/etc/mkinitcpio.conf
113
+ #/etc/local.gen
114
+
115
+
116
+ #grub
117
+ echo "grep -v rootfs /proc/mounts > /etc/mtab" |chroot /newarch sh -
118
+ chroot /newarch grub-install /dev/sda
119
+ echo "cp -a /usr/lib/grub/i386-pc/* /boot/grub" | chroot /newarch sh -
120
+
121
+ #/boot/grub/menu.lst
122
+
123
+ echo "sed -i 's:^kernel\(.*\)$:kernel /boot/vmlinuz26 root=/dev/sda1 ro:' /boot/grub/menu.lst" | chroot /newarch sh -
124
+ echo "sed -i 's:^initrd\(.*\)$:initrd /boot/kernel26.img:' /boot/grub/menu.lst" | chroot /newarch sh -
125
+
126
+ #Configure ssh
127
+ chroot /newarch pacman --noconfirm -S openssh
128
+
129
+ #Still errors
130
+ echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf" | chroot /newarch sh -
131
+ echo "echo 'sshd:ALL' > /etc/hosts.allow" | chroot /newarch sh -
132
+ echo "echo 'ALL:ALL' > /etc/hosts.deny" | chroot /newarch sh -
133
+
134
+ #Configure Sudo
135
+ chroot /newarch pacman --noconfirm -S sudo
136
+ echo "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" | chroot /newarch sh -
137
+
138
+ #create vagrant user / password vagrant
139
+ chroot /newarch useradd -m -r vagrant -p '$1$MPmczGP9$1SeNO4bw5YgiEJuo/ZkWq1'
140
+
141
+ #get some ruby running
142
+ chroot /newarch pacman --noconfirm -S git curl gcc make
143
+ echo "bash < <( curl -L http://bit.ly/rvm-install-system-wide )"| chroot /newarch /bin/bash -
144
+ echo "/usr/local/bin/rvm install ruby-1.8.7 "| chroot /newarch sh -
145
+ echo "/usr/local/bin/rvm use ruby-1.8.7 --default "| chroot /newarch sh -
146
+
147
+
148
+ #Installing chef & Puppet
149
+ echo ". /usr/local/lib/rvm ; gem install chef --no-ri --no-rdoc"| chroot /newarch sh -
150
+ echo ". /usr/local/lib/rvm ; gem install puppet --no-ri --no-rdoc"| chroot /newarch sh -
151
+
152
+ #Installing vagrant keys
153
+ echo "creating vagrant ssh keys"
154
+ chroot /newarch mkdir /home/vagrant/.ssh
155
+ chroot /newarch chmod 700 /home/vagrant/.ssh
156
+ chroot /newarch cd /home/vagrant/.ssh
157
+ chroot /newarch wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
158
+ chroot /newarch chmod 600 /home/vagrant/.ssh/authorized_keys
159
+ chroot /newarch chown -R vagrant /home/vagrant/.ssh
160
+
161
+ echo "adding rvm to global bash rc"
162
+ echo "echo '. /usr/local/lib/rvm' >> /etc/bash/bash.rc" | chroot /newarch sh -
163
+
164
+ #https://wiki.archlinux.org/index.php/VirtualBox
165
+ #kernel pacman -S kernel26-headers
166
+ chroot /newarch pacman --noconfirm -S kernel26-headers
167
+ #/bin/cp -f /root/.vbox_version /newarch/root/.vbox_version
168
+ #VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
169
+ ##INstalling the virtualbox guest additions
170
+ #cd /tmp
171
+ #wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
172
+ #mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
173
+ #sh /mnt/VBoxLinuxAdditions.run
174
+ #chroot /newarch umount /mnt
175
+ #rm VBoxGuestAdditions_$VBOX_VERSION.iso
176
+
177
+ echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 rc.vboxadd):' /etc/rc.conf" | chroot /newarch sh -
178
+
179
+
180
+ cd /
181
+ umount /newarch/{proc,sys,dev}
182
+ umount /newarch
183
+
184
+ reboot
@@ -6,7 +6,7 @@ Veewee::Session.declare( {
6
6
  :boot_wait => "10",:boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
7
7
  :kickstart_port => "7122", :kickstart_timeout => 10000,:kickstart_file => "ks.cfg",
8
8
  :ssh_login_timeout => "100",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
9
- :ssh_host_port => "2222", :ssh_guest_port => "22",
9
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
10
10
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
11
11
  :shutdown_cmd => "/sbin/halt -h -p",
12
12
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => 10000
@@ -18,8 +18,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
18
18
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
19
19
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
20
20
 
21
- #Installing chef
21
+ #Installing chef & Puppet
22
22
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
23
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
23
24
 
24
25
  #Installing vagrant keys
25
26
  mkdir /home/vagrant/.ssh
@@ -9,7 +9,7 @@ Veewee::Session.declare( {
9
9
  :boot_wait => "10",:boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
10
  :kickstart_port => "7122", :kickstart_timeout => 10000,:kickstart_file => "ks.cfg",
11
11
  :ssh_login_timeout => "100",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
12
- :ssh_host_port => "2222", :ssh_guest_port => "22",
12
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
13
13
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
14
  :shutdown_cmd => "/sbin/halt -h -p",
15
15
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => 10000
@@ -18,8 +18,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
18
18
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
19
19
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
20
20
 
21
- #Installing chef
21
+ #Installing chef & Puppet
22
22
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
23
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
23
24
 
24
25
  #Installing vagrant keys
25
26
  mkdir /home/vagrant/.ssh
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  :kickstart_port => "7122", :kickstart_timeout => 10000,:kickstart_file => "ks.cfg",
10
10
  :ssh_login_timeout => "100",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
11
- :ssh_host_port => "2222", :ssh_guest_port => "22",
11
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
12
12
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
13
13
  :shutdown_cmd => "/sbin/halt -h -p",
14
14
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => 10000
@@ -18,8 +18,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
18
18
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
19
19
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
20
20
 
21
- #Installing chef
21
+ #Installing chef & Puppet
22
22
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
23
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
23
24
 
24
25
  #Installing vagrant keys
25
26
  mkdir /home/vagrant/.ssh
@@ -1,59 +1,3 @@
1
1
  #!/bin/bash
2
2
 
3
- #https://wiki.archlinux.org/index.php/Install_from_Existing_Linux
4
-
5
- ARCH=i686
6
- mkdir /tmp/archlinux
7
- cd /tmp/archlinux
8
-
9
- alias wget='wget --trust-server-names'
10
-
11
- wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/
12
- wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/
13
-
14
- wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/
15
- wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/
16
- wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/
17
- wget http://www.archlinux.org/packages/core/$ARCH/xz/download/
18
- wget http://www.archlinux.org/packages/core/$ARCH/expat/download/
19
-
20
- for f in *.tar.gz ; do tar xzvf $f ; done
21
-
22
- export PATH=/tmp/archlinux/usr/bin:$PATH
23
- export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:$LD_LIBRARY_PATH
24
- alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf"
25
-
26
- cd /
27
- for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do
28
- tar xzf $f
29
- done
30
-
31
- #needs fdisk first
32
- mkfs.ext3 /dev/sda1
33
- mkfs.ext3 -j -O dir_index /dev/sda1
34
-
35
- mkreiserfs /dev/sdxx
36
-
37
- mkswap /dev/sda2
38
- swapon /dev/sda2
39
-
40
- mkdir /newarch
41
- mount /dev/sda1 /newarch
42
-
43
- mkdir -p /newarch/var/lib/pacman
44
- pacman -Sy -r /newarch
45
-
46
- pacman --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch
47
-
48
- cd /newarch/dev
49
- rm console ; mknod -m 600 console c 5 1
50
- rm null ; mknod -m 666 null c 1 3
51
- rm zero ; mknod -m 666 zero c 1 5
52
-
53
- cp /etc/resolv.conf /newarch/etc/
54
-
55
- mount -t proc proc /newarch/proc
56
- mount -t sysfs sys /newarch/sys
57
- mount -o bind /dev /newarch/dev
58
-
59
- chroot /newroot pacman -S kernel26
3
+ echo "we made it to autorun"
@@ -13,8 +13,8 @@ Veewee::Session.declare( {
13
13
  ],
14
14
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "autorun0",
15
15
  :ssh_login_timeout => "10000",:ssh_user => "root", :ssh_password => "vagrant",:ssh_key => "",
16
- :ssh_host_port => "2222", :ssh_guest_port => "22",
17
- :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
16
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
17
+ :sudo_cmd => "sh '%f'",
18
18
  :shutdown_cmd => "shutdown -H",
19
19
  :postinstall_files => [ ],:postinstall_timeout => "10000"
20
20
  }
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -H",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -18,8 +18,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
18
18
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
19
19
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
20
20
 
21
- #Installing chef
21
+ #Installing chef & Puppet
22
22
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
23
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
23
24
 
24
25
  #Installing vagrant keys
25
26
  mkdir /home/vagrant/.ssh
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -H",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -20,8 +20,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
20
20
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
21
21
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
22
22
 
23
- #Installing chef
23
+ #Installing chef & Puppet
24
24
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
25
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
25
26
 
26
27
  #Installing vagrant keys
27
28
  mkdir /home/vagrant/.ssh
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -P now",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -20,8 +20,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
20
20
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
21
21
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
22
22
 
23
- #Installing chef
23
+ #Installing chef & Puppet
24
24
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
25
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
25
26
 
26
27
  #Installing vagrant keys
27
28
  mkdir /home/vagrant/.ssh
@@ -78,10 +78,12 @@ d-i pkgsel/update-policy select none
78
78
  #Use mirror
79
79
  #d-i apt-setup/use_mirror boolean true
80
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
81
+ d-i mirror/country string US
82
+
83
+ d-i mirror/protocol string http
84
+ d-i mirror/country string manual
85
+ d-i mirror/http/hostname string us.archive.ubuntu.com
86
+ d-i mirror/http/directory string /ubuntu
87
+ d-i mirror/suite select maverick
88
+ d-i mirror/http/proxy string
85
89
  #d-i debian-installer/allow_unauthenticated string true
86
-
87
- choose-mirror-bin mirror/http/proxy string
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -P now",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -20,8 +20,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
20
20
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
21
21
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
22
22
 
23
- #Installing chef
24
- /opt/ruby/bin/gem install chef --no-ri --no-rdoc
23
+ #Installing chef & Puppet
24
+ /opt/ruby/bin/gem install chef --no-ri --no-rdoc
25
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
25
26
 
26
27
  #Installing vagrant keys
27
28
  mkdir /home/vagrant/.ssh
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -P now",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -20,8 +20,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
20
20
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
21
21
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
22
22
 
23
- #Installing chef
23
+ #Installing chef & Puppet
24
24
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
25
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
25
26
 
26
27
  #Installing vagrant keys
27
28
  mkdir /home/vagrant/.ssh
@@ -78,10 +78,12 @@ d-i pkgsel/update-policy select none
78
78
  #Use mirror
79
79
  #d-i apt-setup/use_mirror boolean true
80
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
81
+ d-i mirror/country string US
82
+
83
+ d-i mirror/protocol string http
84
+ d-i mirror/country string manual
85
+ d-i mirror/http/hostname string us.archive.ubuntu.com
86
+ d-i mirror/http/directory string /ubuntu
87
+ d-i mirror/suite select maverick
88
+ d-i mirror/http/proxy string
85
89
  #d-i debian-installer/allow_unauthenticated string true
86
-
87
- choose-mirror-bin mirror/http/proxy string
@@ -17,7 +17,7 @@ Veewee::Session.declare( {
17
17
  ],
18
18
  :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
19
19
  :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
20
- :ssh_host_port => "2222", :ssh_guest_port => "22",
20
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
21
21
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
22
22
  :shutdown_cmd => "shutdown -P now",
23
23
  :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
@@ -20,8 +20,9 @@ echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
20
20
  rm -rf ./ruby-enterprise-1.8.7-2010.02/
21
21
  rm ruby-enterprise-1.8.7-2010.02.tar.gz
22
22
 
23
- #Installing chef
23
+ #Installing chef & Puppet
24
24
  /opt/ruby/bin/gem install chef --no-ri --no-rdoc
25
+ /opt/ruby/bin/gem install puppet --no-ri --no-rdoc
25
26
 
26
27
  #Installing vagrant keys
27
28
  mkdir /home/vagrant/.ssh
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veewee
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Debois
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-08 00:00:00 +01:00
19
+ date: 2011-02-09 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -159,6 +159,9 @@ files:
159
159
  - lib/veewee/transaction.rb
160
160
  - lib/veewee/version.rb
161
161
  - lib/veewee/web.rb
162
+ - templates/Archlinux-experimental/autorun0
163
+ - templates/Archlinux-experimental/definition.rb
164
+ - templates/Archlinux-experimental/postinstall.sh
162
165
  - templates/CentOS-4.8-i386/definition.rb
163
166
  - templates/CentOS-4.8-i386/ks.cfg
164
167
  - templates/CentOS-4.8-i386/postinstall.sh