vagrant 0.5.1 → 0.5.2
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.
- data/README.md +8 -6
- data/lib/vagrant/action/vm/package_vagrantfile.rb +1 -1
- data/lib/vagrant/commands/init.rb +12 -8
- data/lib/vagrant/provisioners/chef_server.rb +1 -1
- data/lib/vagrant/provisioners/chef_solo.rb +1 -1
- data/lib/vagrant/ssh.rb +2 -1
- data/lib/vagrant/util/template_renderer.rb +1 -1
- data/lib/vagrant/version.rb +1 -1
- data/lib/vagrant/vm.rb +1 -0
- data/templates/Vagrantfile.erb +6 -0
- data/templates/ssh_config.erb +1 -0
- data/templates/strings.yml +1 -1
- metadata +4 -4
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
|
-
|
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
|
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 `
|
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["
|
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
|
20
|
-
|
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
|
-
#
|
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,
|
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|
|
data/lib/vagrant/ssh.rb
CHANGED
@@ -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", "-
|
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
|
data/lib/vagrant/version.rb
CHANGED
data/lib/vagrant/vm.rb
CHANGED
data/templates/Vagrantfile.erb
CHANGED
@@ -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
|
data/templates/ssh_config.erb
CHANGED
data/templates/strings.yml
CHANGED
@@ -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
|
-
|
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
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-
|
19
|
+
date: 2010-08-03 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|