Merge branch 'master' of github.com:mitchellh/vagrant into winrm_error_handling

Conflicts:
	plugins/communicators/winrm/config.rb
	plugins/communicators/winrm/shell.rb
	test/unit/plugins/communicators/winrm/shell_test.rb
This commit is contained in:
Max Lincoln 2015-02-16 10:30:12 -05:00
commit 583254b2b7
9 changed files with 101 additions and 13 deletions

View File

@ -14,6 +14,7 @@ BUG FIXES:
- provisioners/ansible: fix SSH settings to support more than 5 ssh keys [GH-5017]
- provisioners/ansible: increase ansible connection timeout to 30 seconds [GH-5018]
- provisioners/docker: use docker.com instead of docker.io [GH-5216]
- pushes/atlas: send additional box metadata [GH-5283]
## 1.7.2 (January 6, 2015)

View File

@ -27,6 +27,7 @@ module VagrantPlugins
cmd << "-vcs" if config.vcs
cmd += config.includes.map { |v| ["-include", v] }
cmd += config.excludes.map { |v| ["-exclude", v] }
cmd += metadata.map { |k,v| ["-metadata", "#{k}=#{v}"] }
cmd += ["-address", config.address] if config.address
cmd += ["-token", config.token] if config.token
cmd << config.app
@ -40,8 +41,7 @@ module VagrantPlugins
# @return [String]
def uploader_path
# Determine the uploader path
uploader = config.uploader_path
if uploader
if uploader = config.uploader_path
return uploader
end
@ -53,6 +53,26 @@ module VagrantPlugins
return Vagrant::Util::Which.which(UPLOADER_BIN)
end
# The metadata command for this push.
#
# @return [Array<String>]
def metadata
box = env.vagrantfile.config.vm.box
box_url = env.vagrantfile.config.vm.box_url
result = {}
if !box.nil? && !box.empty?
result["box"] = box
end
if !box_url.nil? && !box_url.empty?
result["box_url"] = Array(box_url).first
end
return result
end
end
end
end

View File

@ -9,9 +9,9 @@ describe VagrantPlugins::AtlasPush::Push do
let(:bin) { VagrantPlugins::AtlasPush::Push::UPLOADER_BIN }
let(:env) do
double("env",
root_path: File.expand_path("..", __FILE__)
)
iso_env = isolated_environment
iso_env.vagrantfile("")
iso_env.create_vagrant_env
end
let(:config) do
@ -99,6 +99,29 @@ describe VagrantPlugins::AtlasPush::Push do
config.token = "atlas_token"
subject.execute("foo")
end
context "when metadata is available" do
let(:env) do
iso_env = isolated_environment
iso_env.vagrantfile <<-EOH
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.box_url = "https://atlas.hashicorp.com/hashicorp/precise64"
end
EOH
iso_env.create_vagrant_env
end
it "sends the metadata" do
expect(Vagrant::Util::SafeExec).to receive(:exec).
with("foo", "-vcs", "-metadata", "box=hashicorp/precise64",
"-metadata", "box_url=https://atlas.hashicorp.com/hashicorp/precise64",
"-token", "atlas_token", app, env.root_path.to_s)
config.token = "atlas_token"
subject.execute("foo")
end
end
end
describe "#uploader_path" do

View File

@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_dependency "rb-kqueue", "~> 0.2.0"
s.add_dependency "rest-client", ">= 1.6.0", "< 2.0"
s.add_dependency "wdm", "~> 0.1.0"
s.add_dependency "winrm", "~> 1.3.0"
s.add_dependency "winrm", "~> 1.3"
s.add_dependency "winrm-fs", "~> 0.1.0"
# We lock this down to avoid compilation issues.

View File

@ -22,3 +22,8 @@ accepts.
In depth documentation and use cases of various Vagrant commands is
available by reading the appropriate sub-section available in the left
navigational area of this site.
You may also wish to consult the
[documentation](/v2/other/environmental-variables.html) regarding the
environmental variables that can be used to configure and control
Vagrant in a global way.

View File

@ -5,8 +5,8 @@ sidebar_current: "gettingstarted-projectsetup"
# Project Setup
The first step for any project to use Vagrant is to configure Vagrant
using a [Vagrantfile](/v2/vagrantfile/index.html). The purpose of the
The first step in configuring any Vagrant project is to create a
[Vagrantfile](/v2/vagrantfile/index.html). The purpose of the
Vagrantfile is twofold:
1. Mark the root directory of your project. A lot of the configuration

View File

@ -9,6 +9,14 @@ Vagrant has a set of environmental variables that can be used to
configure and control it in a global way. This page lists those environmental
variables.
## VAGRANT\_CHECKPOINT\_DISABLE
Vagrant does occasional network calls to check whether the version of Vagrant
that is running locally is up to date. We understand that software making remote
calls over the internet for any reason can be undesirable. To surpress these
calls, set the environment variable `VAGRANT_CHECKPOINT_DISABLE` to any
non-empty value.
## VAGRANT\_CWD
`VAGRANT_CWD` can be set to change the working directory of Vagrant. By

View File

@ -36,10 +36,22 @@ a single push definition.
The Vagrant Push Local Exec strategy is defined in the `Vagrantfile` using the
`local-exec` key:
Remote path:
```ruby
config.push.define "local-exec" do |push|
push.inline = <<-SCRIPT
scp . /var/www/website
scp -r . server:/var/www/website
SCRIPT
end
```
Local path:
```ruby
config.push.define "local-exec" do |push|
push.inline = <<-SCRIPT
cp -r . /var/www/website
SCRIPT
end
```

View File

@ -15,10 +15,29 @@ Fusion, and `vmware_workstation` for VMware Workstation.
The Vagrant VMware provider does not support parallel execution at this time.
Specifying the `--parallel` option will have no effect.
<p>
To get started, a 64-bit Ubuntu 12.04 LTS VMware box is available at:
<a href="http://files.vagrantup.com/precise64_vmware.box">http://files.vagrantup.com/precise64_vmware.box</a>
</p>
To get started, create a new `Vagrantfile` that points to a VMware box:
```ruby
# vagrant init hashicorp/precise64
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
end
```
VMware Fusion users should then run:
```shell
$ vagrant up --provider vmware_fusion
```
VMware Workstation users should then run:
```shell
$ vagrant up --provider vmware_workstation
```
This will download and bring up a new VMware Fusion/Workstation virtual machine
in Vagrant.
<div class="alert alert-info">
<p>