vagrant 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,14 +18,17 @@ First, make sure your development machine has [VirtualBox](http://www.virtualbox
18
18
  installed. The setup from that point forward is very easy, since Vagrant is simply
19
19
  a rubygem.
20
20
 
21
- sudo gem install vagrant
21
+ gem install vagrant
22
22
 
23
23
  To build your first virtual environment:
24
24
 
25
- vagrant init
26
- vagrant box add base http://files.vagrantup.com/base.box
25
+ vagrant init lucid32 http://files.vagrantup.com/lucid32.box
27
26
  vagrant up
28
27
 
28
+ Note: The above `vagrant up` command will also trigger Vagrant to download the
29
+ `lucid32` box via the specified URL. Vagrant only does this if it detects that
30
+ the box doesn't already exist on your system.
31
+
29
32
  ## Getting Started Guide and Video
30
33
 
31
34
  To learn how to build a fully functional rails development environment, view the
@@ -40,13 +43,12 @@ covers a few parts of Vagrant in more detail than the website guide.
40
43
  If you want the bleeding edge version of Vagrant, we try to keep master pretty stable
41
44
  and you're welcome to give it a shot. The following is an example showing how to do this:
42
45
 
43
- rake build
44
- sudo rake install
46
+ rake install
45
47
 
46
48
  ## Contributing to Vagrant
47
49
 
48
50
  To hack on vagrant, you'll need [bundler](http://github.com/carlhuda/bundler) which can
49
- be installed with a simple `sudo gem install bundler`. Afterwords, do the following:
51
+ be installed with a simple `gem install bundler`. Afterwords, do the following:
50
52
 
51
53
  bundle install
52
54
  bundle exec rake
@@ -21,7 +21,7 @@ module Vagrant
21
21
  # box. This Vagrantfile contains the MAC address so that the user doesn't
22
22
  # have to worry about it.
23
23
  def create_vagrantfile
24
- File.open(File.join(@env["package.directory"], "Vagrantfile"), "w") do |f|
24
+ File.open(File.join(@env["export.temp_dir"], "Vagrantfile"), "w") do |f|
25
25
  f.write(TemplateRenderer.render("package_Vagrantfile", {
26
26
  :base_mac => @env["vm"].vm.network_adapters.first.mac_address
27
27
  }))
@@ -5,28 +5,32 @@ module Vagrant
5
5
  description "Initializes current folder for Vagrant usage"
6
6
 
7
7
  def execute(args)
8
- create_vagrantfile(args[0])
8
+ create_vagrantfile(:default_box => args[0] , :default_box_url => args[1])
9
9
  end
10
10
 
11
11
  def options_spec(opts)
12
- opts.banner = "Usage: vagrant init [name]"
12
+ opts.banner = "Usage: vagrant init [name] [box_url]"
13
13
  end
14
14
 
15
15
  # Actually writes the initial Vagrantfile to the current working directory.
16
16
  # The Vagrantfile will contain the base box configuration specified, or
17
17
  # will just use "base" if none is specified.
18
18
  #
19
- # @param [String] default_box The default base box for this Vagrantfile
20
- def create_vagrantfile(default_box=nil)
19
+ # @param [String] :default_box The default base box for this
20
+ # Vagrantfile
21
+ # @param [String] :default_box_url The default url for fetching
22
+ # the given box for the Vagrantfile
23
+ def create_vagrantfile(opts={})
21
24
  rootfile_path = File.join(Dir.pwd, Environment::ROOTFILE_NAME)
22
25
  error_and_exit(:rootfile_already_exists) if File.exist?(rootfile_path)
23
26
 
24
- # Write the rootfile
25
- default_box ||= "base"
27
+ # Set the defaults of the Vagrantfile
28
+ opts[:default_box] ||= "base"
29
+
26
30
  File.open(rootfile_path, 'w+') do |f|
27
- f.write(TemplateRenderer.render(Environment::ROOTFILE_NAME, :default_box => default_box))
31
+ f.write(TemplateRenderer.render(Environment::ROOTFILE_NAME, opts))
28
32
  end
29
33
  end
30
34
  end
31
35
  end
32
- end
36
+ end
@@ -48,7 +48,7 @@ module Vagrant
48
48
  end
49
49
 
50
50
  def run_chef_client
51
- command = "cd #{env.config.chef.provisioning_path} && sudo chef-client -c client.rb -j dna.json"
51
+ command = "cd #{env.config.chef.provisioning_path} && sudo -E chef-client -c client.rb -j dna.json"
52
52
 
53
53
  logger.info "Running chef-client..."
54
54
  vm.ssh.execute do |ssh|
@@ -38,7 +38,7 @@ module Vagrant
38
38
  end
39
39
 
40
40
  def run_chef_solo
41
- command = "cd #{env.config.chef.provisioning_path} && sudo chef-solo -c solo.rb -j dna.json"
41
+ command = "cd #{env.config.chef.provisioning_path} && sudo -E chef-solo -c solo.rb -j dna.json"
42
42
 
43
43
  logger.info "Running chef-solo..."
44
44
  vm.ssh.execute do |ssh|
@@ -33,7 +33,8 @@ module Vagrant
33
33
 
34
34
  # Command line options
35
35
  command_options = ["-p #{options[:port]}", "-o UserKnownHostsFile=/dev/null",
36
- "-o StrictHostKeyChecking=no", "-i #{options[:private_key_path]}"]
36
+ "-o StrictHostKeyChecking=no", "-o IdentitiesOnly=yes",
37
+ "-i #{options[:private_key_path]}"]
37
38
  command_options << "-o ForwardAgent=yes" if env.config.ssh.forward_agent
38
39
 
39
40
  # Some hackery going on here. On Mac OS X Leopard (10.5), exec fails
@@ -68,7 +68,7 @@ module Vagrant
68
68
  #
69
69
  # @return [String]
70
70
  def render_string
71
- ERB.new(template).result(binding)
71
+ ERB.new(template, nil, "%<>-").result(binding)
72
72
  end
73
73
 
74
74
  # Returns the full path to the template, taking into accoun the gem directory
@@ -2,5 +2,5 @@ module Vagrant
2
2
  # This will always be up to date with the current version of Vagrant,
3
3
  # since it is used to generate the gemspec and is also the source of
4
4
  # the version for `vagrant -v`
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
  end
@@ -103,6 +103,7 @@ module Vagrant
103
103
 
104
104
  def start
105
105
  return if @vm.running?
106
+ return resume if @vm.saved?
106
107
 
107
108
  env.actions.run(:start)
108
109
  end
@@ -5,4 +5,10 @@ Vagrant::Config.run do |config|
5
5
 
6
6
  # Every Vagrant virtual environment requires a box to build off of.
7
7
  config.vm.box = "<%= default_box %>"
8
+
9
+ <% if !default_box_url.nil? -%>
10
+ # The url from where the 'config.vm.box' box will be fetched if it
11
+ # doesn't already exist on the user's system
12
+ config.vm.box_url = "<%= default_box_url %>"
13
+ <% end -%>
8
14
  end
@@ -6,3 +6,4 @@ Host <%= host_key %>
6
6
  StrictHostKeyChecking no
7
7
  PasswordAuthentication no
8
8
  IdentityFile <%= private_key_path %>
9
+ IdentitiesOnly yes
@@ -191,7 +191,7 @@
191
191
  Unknown provisioner type: <%= provisioner %>
192
192
  :rootfile_already_exists: |-
193
193
  It looks like this directory is already setup for vagrant! (A <%= Vagrant::Environment::ROOTFILE_NAME %>
194
- already exists.)
194
+ already exists.)
195
195
  :rootfile_not_found: |-
196
196
  A `<%= Vagrant::Environment::ROOTFILE_NAME %>` was not found! This file is required for vagrant to run
197
197
  since it describes the expected environment that vagrant is supposed
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mitchell Hashimoto
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-31 00:00:00 -07:00
19
+ date: 2010-08-03 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency