vagrantup 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/bin/vagrant +1 -1
  6. data/bin/vagrant-box +1 -2
  7. data/bin/vagrant-down +1 -2
  8. data/bin/vagrant-halt +1 -2
  9. data/bin/vagrant-init +1 -2
  10. data/bin/vagrant-package +1 -2
  11. data/bin/vagrant-reload +1 -2
  12. data/bin/vagrant-resume +1 -2
  13. data/bin/vagrant-ssh +1 -2
  14. data/bin/vagrant-status +29 -0
  15. data/bin/vagrant-suspend +1 -2
  16. data/bin/vagrant-up +1 -2
  17. data/config/default.rb +5 -9
  18. data/keys/README.md +10 -0
  19. data/keys/vagrant +27 -0
  20. data/keys/vagrant.pub +1 -0
  21. data/lib/vagrant.rb +10 -5
  22. data/lib/vagrant/actions/base.rb +14 -0
  23. data/lib/vagrant/actions/box/download.rb +3 -0
  24. data/lib/vagrant/actions/collection.rb +36 -0
  25. data/lib/vagrant/actions/runner.rb +4 -10
  26. data/lib/vagrant/actions/vm/boot.rb +4 -5
  27. data/lib/vagrant/actions/vm/customize.rb +17 -0
  28. data/lib/vagrant/actions/vm/destroy.rb +11 -2
  29. data/lib/vagrant/actions/vm/forward_ports.rb +24 -0
  30. data/lib/vagrant/actions/vm/import.rb +1 -0
  31. data/lib/vagrant/actions/vm/provision.rb +30 -52
  32. data/lib/vagrant/actions/vm/reload.rb +2 -2
  33. data/lib/vagrant/actions/vm/shared_folders.rb +37 -25
  34. data/lib/vagrant/actions/vm/up.rb +8 -4
  35. data/lib/vagrant/active_list.rb +66 -0
  36. data/lib/vagrant/commands.rb +44 -0
  37. data/lib/vagrant/config.rb +64 -47
  38. data/lib/vagrant/downloaders/base.rb +3 -0
  39. data/lib/vagrant/downloaders/file.rb +11 -11
  40. data/lib/vagrant/env.rb +48 -12
  41. data/lib/vagrant/provisioners/base.rb +22 -0
  42. data/lib/vagrant/provisioners/chef.rb +102 -0
  43. data/lib/vagrant/provisioners/chef_server.rb +96 -0
  44. data/lib/vagrant/provisioners/chef_solo.rb +67 -0
  45. data/lib/vagrant/ssh.rb +25 -6
  46. data/lib/vagrant/stacked_proc_runner.rb +33 -0
  47. data/lib/vagrant/vm.rb +8 -0
  48. data/test/test_helper.rb +22 -6
  49. data/test/vagrant/actions/box/download_test.rb +11 -0
  50. data/test/vagrant/actions/collection_test.rb +110 -0
  51. data/test/vagrant/actions/runner_test.rb +11 -7
  52. data/test/vagrant/actions/vm/boot_test.rb +7 -7
  53. data/test/vagrant/actions/vm/customize_test.rb +16 -0
  54. data/test/vagrant/actions/vm/destroy_test.rb +19 -6
  55. data/test/vagrant/actions/vm/forward_ports_test.rb +52 -0
  56. data/test/vagrant/actions/vm/import_test.rb +10 -3
  57. data/test/vagrant/actions/vm/provision_test.rb +75 -70
  58. data/test/vagrant/actions/vm/reload_test.rb +3 -2
  59. data/test/vagrant/actions/vm/shared_folders_test.rb +62 -9
  60. data/test/vagrant/actions/vm/up_test.rb +4 -4
  61. data/test/vagrant/active_list_test.rb +169 -0
  62. data/test/vagrant/config_test.rb +145 -29
  63. data/test/vagrant/downloaders/base_test.rb +7 -0
  64. data/test/vagrant/downloaders/file_test.rb +12 -18
  65. data/test/vagrant/env_test.rb +96 -23
  66. data/test/vagrant/provisioners/base_test.rb +27 -0
  67. data/test/vagrant/provisioners/chef_server_test.rb +175 -0
  68. data/test/vagrant/provisioners/chef_solo_test.rb +142 -0
  69. data/test/vagrant/provisioners/chef_test.rb +116 -0
  70. data/test/vagrant/ssh_test.rb +29 -8
  71. data/test/vagrant/stacked_proc_runner_test.rb +43 -0
  72. data/test/vagrant/vm_test.rb +23 -0
  73. data/vagrant.gemspec +34 -7
  74. metadata +33 -5
  75. data/script/vagrant-ssh-expect.sh +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffd836a15024ed281e1843a1d9641c8f2d8c12e6
4
- data.tar.gz: d44a4add3767e321e8a58a111be37258912c7c24
3
+ metadata.gz: f14b71b08aed93d452a7c2f2228cecd0699ee64d
4
+ data.tar.gz: eed47175f676b5c3448da623b490ccae429f8e8f
5
5
  SHA512:
6
- metadata.gz: c915f5739663561b7434c2c4bbf0c265b22fdb758e86d7caf4d621bf465b94475c6f5a749243ffde3f9c709a94f6da38a02f41eee0b8f08436506c2487bf9b1a
7
- data.tar.gz: a08b020df05c86b6c4eef07b4bb7810f08c9188c449593f1e4c599e7e6b1df40637749e323b7dcaa0a07110e3f9a2929c735e661e2a893f762767e6f5dde0e0c
6
+ metadata.gz: 3fc432df825159db92569c2862a979408dd4387ffdf18cdf19979dabd725db09200c42a225273ffcdb8fdf3f8f2ffaecfbbcfe3f6c0b34c78736b5ccc908c332
7
+ data.tar.gz: 97433e3f5136c2b28fff946df2d9e73851b21154d58498d8a7f5d194d95a6584098aab570387b468ed1b66bcdffb5154fafbdf5e781ff67c786d81194eb6e8f4
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source :gemcutter
2
2
 
3
3
  # Gems required for the lib to even run
4
- gem "virtualbox", ">= 0.5.0"
4
+ gem "virtualbox", ">= 0.5.3"
5
5
  gem "net-ssh", ">= 2.0.19"
6
6
  gem "net-scp", ">= 1.0.2"
7
7
  gem "git-style-binaries", ">= 0.1.10"
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gemspec.homepage = "http://github.com/mitchellh/vagrant"
11
11
  gemspec.authors = ["Mitchell Hashimoto", "John Bender"]
12
12
 
13
- gemspec.add_dependency('virtualbox', '>= 0.5.0')
13
+ gemspec.add_dependency('virtualbox', '>= 0.5.3')
14
14
  gemspec.add_dependency('net-ssh', '>= 2.0.19')
15
15
  gemspec.add_dependency('net-scp', '>= 1.0.2')
16
16
  gemspec.add_dependency('json', '>= 1.2.0')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
data/bin/vagrant CHANGED
@@ -9,7 +9,7 @@ end
9
9
  require 'git-style-binary/command'
10
10
 
11
11
  GitStyleBinary.primary do
12
- version "0.1.4"
12
+ version "0.2.0"
13
13
 
14
14
  run { educate }
15
15
  end
data/bin/vagrant-box CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "manage boxes"
data/bin/vagrant-down CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "destroys the vagrant environment"
data/bin/vagrant-halt CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "forcibly halts the vagrant environment"
data/bin/vagrant-init CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "initializes directory for vagrant use"
data/bin/vagrant-package CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "package the current vagrant environment"
data/bin/vagrant-reload CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "reload the vagrant environment"
data/bin/vagrant-resume CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "resumes the vagrant environment"
data/bin/vagrant-ssh CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "opens an SSH connection into the VM"
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ require File.expand_path('../../.bundle/environment', __FILE__)
4
+ rescue LoadError
5
+ # Fallback on rubygems
6
+ require "rubygems"
7
+ end
8
+
9
+ require 'git-style-binary/command'
10
+
11
+ # Get library
12
+ libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
+ require File.expand_path('vagrant', libdir)
14
+
15
+ GitStyleBinary.command do
16
+ short_desc "Outputs the status of the current environment"
17
+ banner <<-EOS
18
+ Usage: #{command.full_name} #{all_options_string}
19
+
20
+ This command outputs the status of the current environment. This command
21
+ tells you whether the environment is created, running, suspended,
22
+ etc.
23
+
24
+ EOS
25
+
26
+ run do |command|
27
+ Vagrant::Commands.status
28
+ end
29
+ end
data/bin/vagrant-suspend CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "suspends the vagrant environment"
data/bin/vagrant-up CHANGED
@@ -10,8 +10,7 @@ require 'git-style-binary/command'
10
10
 
11
11
  # Get library
12
12
  libdir = File.join(File.dirname(__FILE__), '..', 'lib')
13
- $:.unshift(libdir) unless $:.include?(libdir)
14
- require 'vagrant'
13
+ require File.expand_path('vagrant', libdir)
15
14
 
16
15
  GitStyleBinary.command do
17
16
  short_desc "create the vagrant environment"
data/config/default.rb CHANGED
@@ -9,22 +9,18 @@ Vagrant::Config.run do |config|
9
9
  config.ssh.host = "localhost"
10
10
  config.ssh.forwarded_port_key = "ssh"
11
11
  config.ssh.max_tries = 10
12
- config.ssh.timeout = 10
12
+ config.ssh.timeout = 30
13
+ config.ssh.private_key_path = File.join(PROJECT_ROOT, 'keys', 'vagrant')
13
14
 
14
15
  config.vm.box_ovf = "box.ovf"
15
16
  config.vm.base_mac = "0800279C2E42"
16
17
  config.vm.project_directory = "/vagrant"
17
18
  config.vm.forward_port("ssh", 22, 2222)
18
19
  config.vm.disk_image_format = 'VMDK'
20
+ config.vm.provisioner = nil
21
+ config.vm.shared_folder_uid = nil
22
+ config.vm.shared_folder_gid = nil
19
23
 
20
24
  config.package.name = 'vagrant'
21
25
  config.package.extension = '.box'
22
-
23
- config.chef.enabled = false
24
- config.chef.cookbooks_path = "cookbooks"
25
- config.chef.provisioning_path = "/tmp/vagrant-chef"
26
- config.chef.json = {
27
- :instance_role => "vagrant",
28
- :recipes => ["vagrant_main"]
29
- }
30
26
  end
data/keys/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # Insecure Keypair
2
+
3
+ These keys are the "insecure" public/private keypair we offer to
4
+ [base box creators](http://vagrantup.com/docs/base_boxes.html) for use in their base boxes so that
5
+ vagrant installations can automatically SSH into the boxes.
6
+
7
+ If you're working with a team or company or with a custom box and
8
+ you want more secure SSH, you should create your own keypair
9
+ and configure the private key in the Vagrantfile with
10
+ `config.ssh.private_key_path`
data/keys/vagrant ADDED
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
3
+ w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
4
+ kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2
5
+ hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO
6
+ Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW
7
+ yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd
8
+ ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1
9
+ Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf
10
+ TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK
11
+ iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A
12
+ sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf
13
+ 4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP
14
+ cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk
15
+ EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN
16
+ CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX
17
+ 3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG
18
+ YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj
19
+ 3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+
20
+ dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz
21
+ 6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC
22
+ P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF
23
+ llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ
24
+ kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
25
+ +vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
26
+ NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
27
+ -----END RSA PRIVATE KEY-----
data/keys/vagrant.pub ADDED
@@ -0,0 +1 @@
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== johnbender@vagrant.local
data/lib/vagrant.rb CHANGED
@@ -1,14 +1,19 @@
1
1
  libdir = File.dirname(__FILE__)
2
- $:.unshift(libdir)
3
2
  PROJECT_ROOT = File.join(libdir, '..') unless defined?(PROJECT_ROOT)
4
3
 
5
4
  # The libs which must be loaded prior to the rest
6
5
  %w{tempfile open-uri json pathname logger uri net/http virtualbox net/ssh archive/tar/minitar
7
- net/scp fileutils vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner}.each do |f|
8
- require f
6
+ net/scp fileutils}.each do |lib|
7
+ require lib
8
+ end
9
+
10
+ # The vagrant specific files which must be loaded prior to the rest
11
+ %w{vagrant/util vagrant/stacked_proc_runner vagrant/actions/base vagrant/downloaders/base vagrant/actions/collection
12
+ vagrant/actions/runner vagrant/config vagrant/provisioners/base vagrant/provisioners/chef}.each do |f|
13
+ require File.expand_path(f, libdir)
9
14
  end
10
15
 
11
16
  # Glob require the rest
12
- Dir[File.join(PROJECT_ROOT, "lib", "vagrant", "**", "*.rb")].each do |f|
13
- require f
17
+ Dir[File.join(libdir, "vagrant", "**", "*.rb")].each do |f|
18
+ require File.expand_path(f)
14
19
  end
@@ -82,6 +82,20 @@ module Vagrant
82
82
  # all your own exceptions, otherwise it'll mask the initially raised
83
83
  # exception.
84
84
  def rescue(exception); end
85
+
86
+ # The following two methods are used for declaring action dependencies.
87
+ # For example, you require that the reload action be in place before
88
+ # a your new FooAction you might do the following
89
+ #
90
+ # def follows; [Reload] end
91
+
92
+ # This method is called when the runner is determining the actions that
93
+ # must precede a given action. You would say "This action follows [Action1, Action2]"
94
+ def follows; [] end
95
+
96
+ # This method is called when the runner is determining the actions that
97
+ # must follow a given action. You would say "This action precedes [Action3, Action4]
98
+ def precedes; [] end
85
99
  end
86
100
 
87
101
  # An exception which occured within an action. This should be used instead of
@@ -26,6 +26,9 @@ module Vagrant
26
26
  end
27
27
 
28
28
  raise ActionException.new("Unknown URI type for box download.") unless @downloader
29
+
30
+ # Prepare the downloader
31
+ @downloader.prepare(@runner.uri)
29
32
  end
30
33
 
31
34
  def execute!
@@ -0,0 +1,36 @@
1
+ module Vagrant
2
+ module Actions
3
+ class Collection < Array
4
+ def dependencies!
5
+ each_with_index do |action, i|
6
+ action.follows.each do |klass|
7
+ unless self[0..i].klasses.include?(klass)
8
+ raise DependencyNotSatisfiedException.new("#{action.class} action must follow #{klass}")
9
+ end
10
+ end
11
+
12
+ action.precedes.each do |klass|
13
+ unless self[i..length].klasses.include?(klass)
14
+ raise DependencyNotSatisfiedException.new("#{action.class} action must precede #{klass}")
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ def duplicates?
21
+ klasses.uniq.size != size
22
+ end
23
+
24
+ def duplicates!
25
+ raise DuplicateActionException.new if duplicates?
26
+ end
27
+
28
+ def klasses
29
+ map { |o| o.class }
30
+ end
31
+ end
32
+
33
+ class DuplicateActionException < Exception; end
34
+ class DependencyNotSatisfiedException < Exception; end
35
+ end
36
+ end
@@ -47,7 +47,7 @@ module Vagrant
47
47
  #
48
48
  # @return [Array]
49
49
  def actions
50
- @actions ||= []
50
+ @actions ||= Actions::Collection.new
51
51
  end
52
52
 
53
53
  # Returns the first action instance which matches the given class.
@@ -75,9 +75,9 @@ module Vagrant
75
75
  add_action(single_action, *args)
76
76
  end
77
77
 
78
- # Raising it here might be too late and hard debug where the actions are comming from (meta actions)
79
- raise DuplicateActionException.new if action_klasses.uniq.size < action_klasses.size
80
-
78
+ actions.duplicates!
79
+ actions.dependencies!
80
+
81
81
  # Call the prepare method on each once its
82
82
  # initialized, then call the execute! method
83
83
  begin
@@ -127,12 +127,6 @@ module Vagrant
127
127
  end
128
128
  results
129
129
  end
130
-
131
- def action_klasses
132
- actions.map { |a| a.class }
133
- end
134
130
  end
135
-
136
- class DuplicateActionException < Exception; end
137
131
  end
138
132
  end
@@ -2,6 +2,10 @@ module Vagrant
2
2
  module Actions
3
3
  module VM
4
4
  class Boot < Base
5
+ def prepare
6
+ Vagrant.config.vm.share_folder("vagrant-root", Vagrant.config.vm.project_directory, Env.root_path)
7
+ end
8
+
5
9
  def execute!
6
10
  @runner.invoke_around_callback(:boot) do
7
11
  # Startup the VM
@@ -17,11 +21,6 @@ error
17
21
  end
18
22
  end
19
23
 
20
- def collect_shared_folders
21
- # The root shared folder for the project
22
- ["vagrant-root", Env.root_path, Vagrant.config.vm.project_directory]
23
- end
24
-
25
24
  def boot
26
25
  logger.info "Booting VM..."
27
26
  @runner.vm.start(:headless, true)
@@ -0,0 +1,17 @@
1
+ module Vagrant
2
+ module Actions
3
+ module VM
4
+ class Customize < Base
5
+ def execute!
6
+ logger.info "Running any VM customizations..."
7
+
8
+ # Run the customization procs over the VM
9
+ Vagrant.config.vm.run_procs!(@runner.vm)
10
+
11
+ # Save the vm
12
+ @runner.vm.save(true)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -4,10 +4,19 @@ module Vagrant
4
4
  class Destroy < Base
5
5
  def execute!
6
6
  @runner.invoke_around_callback(:destroy) do
7
- logger.info "Destroying VM and associated drives..."
8
- @runner.vm.destroy(:destroy_image => true)
7
+ destroy_vm
8
+ depersist
9
9
  end
10
10
  end
11
+
12
+ def destroy_vm
13
+ logger.info "Destroying VM and associated drives..."
14
+ @runner.vm.destroy(:destroy_image => true)
15
+ end
16
+
17
+ def depersist
18
+ Env.depersist_vm(@runner)
19
+ end
11
20
  end
12
21
  end
13
22
  end