Merge branch 'master' of github.com:mitchellh/vagrant into winrmssl
Conflicts: vagrant.gemspec
This commit is contained in:
commit
d6e91483a6
|
@ -5,13 +5,16 @@ BUG FIXES:
|
||||||
- core: push configurations are validated with global configs [GH-5130]
|
- core: push configurations are validated with global configs [GH-5130]
|
||||||
- core: remove executable permissions on internal file [GH-5220]
|
- core: remove executable permissions on internal file [GH-5220]
|
||||||
- core: check name and version in `has_plugin?` [GH-5218]
|
- core: check name and version in `has_plugin?` [GH-5218]
|
||||||
|
- core/cli: fix box checksum validation [GH-4665, GH-5221]
|
||||||
- hosts/nfs: allow colons (`:`) in NFS IDs [GH-5222]
|
- hosts/nfs: allow colons (`:`) in NFS IDs [GH-5222]
|
||||||
- guests/funtoo: fix incorrect path in configure networks [GH-4812]
|
- guests/funtoo: fix incorrect path in configure networks [GH-4812]
|
||||||
- plugins/login: allow users to login with a token [GH-5145]
|
- plugins/login: allow users to login with a token [GH-5145]
|
||||||
- providers/hyperv: allow users to configure memory, cpu count, and vmname [GH-5183]
|
- providers/hyperv: allow users to configure memory, cpu count, and vmname [GH-5183]
|
||||||
|
- providers/virtualbox: read netmask from dhcpservers [GH-5233]
|
||||||
- provisioners/ansible: fix SSH settings to support more than 5 ssh keys [GH-5017]
|
- 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/ansible: increase ansible connection timeout to 30 seconds [GH-5018]
|
||||||
- provisioners/docker: use docker.com instead of docker.io [GH-5216]
|
- 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)
|
## 1.7.2 (January 6, 2015)
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,8 @@ module Vagrant
|
||||||
box_download_ca_path = machine.config.vm.box_download_ca_path
|
box_download_ca_path = machine.config.vm.box_download_ca_path
|
||||||
box_download_client_cert = machine.config.vm.box_download_client_cert
|
box_download_client_cert = machine.config.vm.box_download_client_cert
|
||||||
box_download_insecure = machine.config.vm.box_download_insecure
|
box_download_insecure = machine.config.vm.box_download_insecure
|
||||||
|
box_download_checksum_type = machine.config.vm.box_download_checksum_type
|
||||||
|
box_download_checksum = machine.config.vm.box_download_checksum
|
||||||
box_formats = machine.provider_options[:box_format] ||
|
box_formats = machine.provider_options[:box_format] ||
|
||||||
machine.provider_name
|
machine.provider_name
|
||||||
|
|
||||||
|
@ -86,6 +88,8 @@ module Vagrant
|
||||||
box_download_ca_cert: box_download_ca_cert,
|
box_download_ca_cert: box_download_ca_cert,
|
||||||
box_download_ca_path: box_download_ca_path,
|
box_download_ca_path: box_download_ca_path,
|
||||||
box_download_insecure: box_download_insecure,
|
box_download_insecure: box_download_insecure,
|
||||||
|
box_checksum_type: box_download_checksum_type,
|
||||||
|
box_checksum: box_download_checksum,
|
||||||
}))
|
}))
|
||||||
rescue Errors::BoxAlreadyExists
|
rescue Errors::BoxAlreadyExists
|
||||||
# Just ignore this, since it means the next part will succeed!
|
# Just ignore this, since it means the next part will succeed!
|
||||||
|
|
|
@ -62,7 +62,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
# We place a process lock around every action that is called
|
# We place a process lock around every action that is called
|
||||||
@logger.info("Running action: #{callable_id}")
|
@logger.info("Running action: #{environment[:action_name]} #{callable_id}")
|
||||||
Util::Busy.busy(int_callback) { callable.call(environment) }
|
Util::Busy.busy(int_callback) { callable.call(environment) }
|
||||||
|
|
||||||
# Return the environment in case there are things in there that
|
# Return the environment in case there are things in there that
|
||||||
|
|
|
@ -1,163 +0,0 @@
|
||||||
require "log4r"
|
|
||||||
|
|
||||||
module VagrantPlugins
|
|
||||||
module CommunicatorWinRM
|
|
||||||
# Manages the file system on the remote guest allowing for file tranfer
|
|
||||||
# between the guest and host.
|
|
||||||
class FileManager
|
|
||||||
def initialize(shell)
|
|
||||||
@logger = Log4r::Logger.new("vagrant::communication::filemanager")
|
|
||||||
@shell = shell
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uploads the given file or directory from the host to the guest (recursively).
|
|
||||||
#
|
|
||||||
# @param [String] The source file or directory path on the host
|
|
||||||
# @param [String] The destination file or directory path on the host
|
|
||||||
def upload(host_src_file_path, guest_dest_file_path)
|
|
||||||
@logger.debug("Upload: #{host_src_file_path} -> #{guest_dest_file_path}")
|
|
||||||
if File.directory?(host_src_file_path)
|
|
||||||
upload_directory(host_src_file_path, guest_dest_file_path)
|
|
||||||
else
|
|
||||||
upload_file(host_src_file_path, guest_dest_file_path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Downloads the given file from the guest to the host.
|
|
||||||
# NOTE: This currently only supports single file download
|
|
||||||
#
|
|
||||||
# @param [String] The source file path on the guest
|
|
||||||
# @param [String] The destination file path on the host
|
|
||||||
def download(guest_src_file_path, host_dest_file_path)
|
|
||||||
@logger.debug("#{guest_src_file_path} -> #{host_dest_file_path}")
|
|
||||||
|
|
||||||
output = @shell.powershell("[System.convert]::ToBase64String([System.IO.File]::ReadAllBytes(\"#{guest_src_file_path}\"))")
|
|
||||||
contents = output[:data].map!{|line| line[:stdout]}.join.gsub("\\n\\r", '')
|
|
||||||
out = Base64.decode64(contents)
|
|
||||||
IO.binwrite(host_dest_file_path, out)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
# Recursively uploads the given directory from the host to the guest
|
|
||||||
#
|
|
||||||
# @param [String] The source file or directory path on the host
|
|
||||||
# @param [String] The destination file or directory path on the host
|
|
||||||
def upload_directory(host_src_file_path, guest_dest_file_path)
|
|
||||||
glob_patt = File.join(host_src_file_path, '**/*')
|
|
||||||
Dir.glob(glob_patt).select { |f| !File.directory?(f) }.each do |host_file_path|
|
|
||||||
guest_file_path = guest_file_path(host_src_file_path, guest_dest_file_path, host_file_path)
|
|
||||||
upload_file(host_file_path, guest_file_path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uploads the given file, but only if the target file doesn't exist
|
|
||||||
# or its MD5 checksum doens't match the host's source checksum.
|
|
||||||
#
|
|
||||||
# @param [String] The source file path on the host
|
|
||||||
# @param [String] The destination file path on the guest
|
|
||||||
def upload_file(host_src_file_path, guest_dest_file_path)
|
|
||||||
if should_upload_file?(host_src_file_path, guest_dest_file_path)
|
|
||||||
tmp_file_path = upload_to_temp_file(host_src_file_path)
|
|
||||||
decode_temp_file(tmp_file_path, guest_dest_file_path)
|
|
||||||
else
|
|
||||||
@logger.debug("Up to date: #{guest_dest_file_path}")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uploads the given file to a new temp file on the guest
|
|
||||||
#
|
|
||||||
# @param [String] The source file path on the host
|
|
||||||
# @return [String] The temp file path on the guest
|
|
||||||
def upload_to_temp_file(host_src_file_path)
|
|
||||||
tmp_file_path = File.join(guest_temp_dir, "winrm-upload-#{rand()}")
|
|
||||||
@logger.debug("Uploading '#{host_src_file_path}' to temp file '#{tmp_file_path}'")
|
|
||||||
|
|
||||||
base64_host_file = Base64.encode64(IO.binread(host_src_file_path)).gsub("\n",'')
|
|
||||||
base64_host_file.chars.to_a.each_slice(8000-tmp_file_path.size) do |chunk|
|
|
||||||
out = @shell.cmd("echo #{chunk.join} >> \"#{tmp_file_path}\"")
|
|
||||||
raise_upload_error_if_failed(out, host_src_file_path, tmp_file_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
tmp_file_path
|
|
||||||
end
|
|
||||||
|
|
||||||
# Moves and decodes the given file temp file on the guest to its
|
|
||||||
# permanent location
|
|
||||||
#
|
|
||||||
# @param [String] The source base64 encoded temp file path on the guest
|
|
||||||
# @param [String] The destination file path on the guest
|
|
||||||
def decode_temp_file(guest_tmp_file_path, guest_dest_file_path)
|
|
||||||
@logger.debug("Decoding temp file '#{guest_tmp_file_path}' to '#{guest_dest_file_path}'")
|
|
||||||
out = @shell.powershell <<-EOH
|
|
||||||
$tmp_file_path = [System.IO.Path]::GetFullPath('#{guest_tmp_file_path}')
|
|
||||||
$dest_file_path = [System.IO.Path]::GetFullPath('#{guest_dest_file_path}')
|
|
||||||
|
|
||||||
if (Test-Path $dest_file_path) {
|
|
||||||
rm $dest_file_path
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$dest_dir = ([System.IO.Path]::GetDirectoryName($dest_file_path))
|
|
||||||
New-Item -ItemType directory -Force -Path $dest_dir
|
|
||||||
}
|
|
||||||
|
|
||||||
$base64_string = Get-Content $tmp_file_path
|
|
||||||
$bytes = [System.Convert]::FromBase64String($base64_string)
|
|
||||||
[System.IO.File]::WriteAllBytes($dest_file_path, $bytes)
|
|
||||||
EOH
|
|
||||||
raise_upload_error_if_failed(out, guest_tmp_file_path, guest_dest_file_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Checks to see if the target file on the guest is missing or out of date.
|
|
||||||
#
|
|
||||||
# @param [String] The source file path on the host
|
|
||||||
# @param [String] The destination file path on the guest
|
|
||||||
# @return [Boolean] True if the file is missing or out of date
|
|
||||||
def should_upload_file?(host_src_file_path, guest_dest_file_path)
|
|
||||||
local_md5 = Digest::MD5.file(host_src_file_path).hexdigest
|
|
||||||
cmd = <<-EOH
|
|
||||||
$dest_file_path = [System.IO.Path]::GetFullPath('#{guest_dest_file_path}')
|
|
||||||
|
|
||||||
if (Test-Path $dest_file_path) {
|
|
||||||
$crypto_provider = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
|
|
||||||
try {
|
|
||||||
$file = [System.IO.File]::Open($dest_file_path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read)
|
|
||||||
$guest_md5 = ([System.BitConverter]::ToString($crypto_provider.ComputeHash($file))).Replace("-","").ToLower()
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
$file.Dispose()
|
|
||||||
}
|
|
||||||
if ($guest_md5 -eq '#{local_md5}') {
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Host "should upload file $dest_file_path"
|
|
||||||
exit 1
|
|
||||||
EOH
|
|
||||||
@shell.powershell(cmd)[:exitcode] == 1
|
|
||||||
end
|
|
||||||
|
|
||||||
# Creates a guest file path equivalent from a host file path
|
|
||||||
#
|
|
||||||
# @param [String] The base host directory we're going to copy from
|
|
||||||
# @param [String] The base guest directory we're going to copy to
|
|
||||||
# @param [String] A full path to a file on the host underneath host_base_dir
|
|
||||||
# @return [String] The guest file path equivalent
|
|
||||||
def guest_file_path(host_base_dir, guest_base_dir, host_file_path)
|
|
||||||
rel_path = File.dirname(host_file_path[host_base_dir.length, host_file_path.length])
|
|
||||||
File.join(guest_base_dir, rel_path, File.basename(host_file_path))
|
|
||||||
end
|
|
||||||
|
|
||||||
def guest_temp_dir
|
|
||||||
@guest_temp ||= (@shell.cmd('echo %TEMP%'))[:data][0][:stdout].chomp
|
|
||||||
end
|
|
||||||
|
|
||||||
def raise_upload_error_if_failed(out, from, to)
|
|
||||||
raise Errors::WinRMFileTransferError,
|
|
||||||
from: from,
|
|
||||||
to: to,
|
|
||||||
message: out.inspect if out[:exitcode] != 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -9,7 +9,7 @@ Vagrant::Util::SilenceWarnings.silence! do
|
||||||
require "winrm"
|
require "winrm"
|
||||||
end
|
end
|
||||||
|
|
||||||
require_relative "file_manager"
|
require "winrm-fs/file_manager"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommunicatorWinRM
|
module CommunicatorWinRM
|
||||||
|
@ -65,11 +65,13 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload(from, to)
|
def upload(from, to)
|
||||||
FileManager.new(self).upload(from, to)
|
file_manager = WinRM::FS::FileManager.new(session)
|
||||||
|
file_manager.upload(from, to)
|
||||||
end
|
end
|
||||||
|
|
||||||
def download(from, to)
|
def download(from, to)
|
||||||
FileManager.new(self).download(from, to)
|
file_manager = WinRM::FS::FileManager.new(session)
|
||||||
|
file_manager.download(from, to)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -265,6 +265,8 @@ module VagrantPlugins
|
||||||
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
||||||
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
||||||
info[:ip] = ip
|
info[:ip] = ip
|
||||||
|
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
||||||
|
info[:netmask] = netmask
|
||||||
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
||||||
info[:lower] = lower
|
info[:lower] = lower
|
||||||
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
||||||
|
|
|
@ -270,6 +270,8 @@ module VagrantPlugins
|
||||||
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
||||||
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
||||||
info[:ip] = ip
|
info[:ip] = ip
|
||||||
|
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
||||||
|
info[:netmask] = netmask
|
||||||
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
||||||
info[:lower] = lower
|
info[:lower] = lower
|
||||||
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
||||||
|
|
|
@ -293,6 +293,8 @@ module VagrantPlugins
|
||||||
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
||||||
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
||||||
info[:ip] = ip
|
info[:ip] = ip
|
||||||
|
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
||||||
|
info[:netmask] = netmask
|
||||||
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
||||||
info[:lower] = lower
|
info[:lower] = lower
|
||||||
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
||||||
|
|
|
@ -302,6 +302,8 @@ module VagrantPlugins
|
||||||
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
info[:network_name] = "HostInterfaceNetworking-#{network}"
|
||||||
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
||||||
info[:ip] = ip
|
info[:ip] = ip
|
||||||
|
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
||||||
|
info[:netmask] = netmask
|
||||||
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
||||||
info[:lower] = lower
|
info[:lower] = lower
|
||||||
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
||||||
|
|
|
@ -27,6 +27,7 @@ module VagrantPlugins
|
||||||
cmd << "-vcs" if config.vcs
|
cmd << "-vcs" if config.vcs
|
||||||
cmd += config.includes.map { |v| ["-include", v] }
|
cmd += config.includes.map { |v| ["-include", v] }
|
||||||
cmd += config.excludes.map { |v| ["-exclude", v] }
|
cmd += config.excludes.map { |v| ["-exclude", v] }
|
||||||
|
cmd += metadata.map { |k,v| ["-metadata", "#{k}=#{v}"] }
|
||||||
cmd += ["-address", config.address] if config.address
|
cmd += ["-address", config.address] if config.address
|
||||||
cmd += ["-token", config.token] if config.token
|
cmd += ["-token", config.token] if config.token
|
||||||
cmd << config.app
|
cmd << config.app
|
||||||
|
@ -40,8 +41,7 @@ module VagrantPlugins
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def uploader_path
|
def uploader_path
|
||||||
# Determine the uploader path
|
# Determine the uploader path
|
||||||
uploader = config.uploader_path
|
if uploader = config.uploader_path
|
||||||
if uploader
|
|
||||||
return uploader
|
return uploader
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -53,6 +53,26 @@ module VagrantPlugins
|
||||||
|
|
||||||
return Vagrant::Util::Which.which(UPLOADER_BIN)
|
return Vagrant::Util::Which.which(UPLOADER_BIN)
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,6 +37,7 @@ shared_examples "a version 4.x virtualbox driver" do |options|
|
||||||
network_name: 'HostInterfaceNetworking-vboxnet0',
|
network_name: 'HostInterfaceNetworking-vboxnet0',
|
||||||
network: 'vboxnet0',
|
network: 'vboxnet0',
|
||||||
ip: '172.28.128.2',
|
ip: '172.28.128.2',
|
||||||
|
netmask: '255.255.255.0',
|
||||||
lower: '172.28.128.3',
|
lower: '172.28.128.3',
|
||||||
upper: '172.28.128.254',
|
upper: '172.28.128.254',
|
||||||
}])
|
}])
|
||||||
|
@ -65,8 +66,8 @@ shared_examples "a version 4.x virtualbox driver" do |options|
|
||||||
|
|
||||||
it "returns a list with one entry for each server" do
|
it "returns a list with one entry for each server" do
|
||||||
expect(subject.read_dhcp_servers).to eq([
|
expect(subject.read_dhcp_servers).to eq([
|
||||||
{network_name: 'HostInterfaceNetworking-vboxnet0', network: 'vboxnet0', ip: '172.28.128.2', lower: '172.28.128.3', upper: '172.28.128.254'},
|
{network_name: 'HostInterfaceNetworking-vboxnet0', network: 'vboxnet0', ip: '172.28.128.2', netmask: '255.255.255.0', lower: '172.28.128.3', upper: '172.28.128.254'},
|
||||||
{network_name: 'HostInterfaceNetworking-vboxnet1', network: 'vboxnet1', ip: '10.0.0.2', lower: '10.0.0.3', upper: '10.0.0.254'},
|
{network_name: 'HostInterfaceNetworking-vboxnet1', network: 'vboxnet1', ip: '10.0.0.2', netmask: '255.255.255.0', lower: '10.0.0.3', upper: '10.0.0.254'},
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,9 +9,9 @@ describe VagrantPlugins::AtlasPush::Push do
|
||||||
let(:bin) { VagrantPlugins::AtlasPush::Push::UPLOADER_BIN }
|
let(:bin) { VagrantPlugins::AtlasPush::Push::UPLOADER_BIN }
|
||||||
|
|
||||||
let(:env) do
|
let(:env) do
|
||||||
double("env",
|
iso_env = isolated_environment
|
||||||
root_path: File.expand_path("..", __FILE__)
|
iso_env.vagrantfile("")
|
||||||
)
|
iso_env.create_vagrant_env
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:config) do
|
let(:config) do
|
||||||
|
@ -99,6 +99,29 @@ describe VagrantPlugins::AtlasPush::Push do
|
||||||
config.token = "atlas_token"
|
config.token = "atlas_token"
|
||||||
subject.execute("foo")
|
subject.execute("foo")
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe "#uploader_path" do
|
describe "#uploader_path" do
|
||||||
|
|
|
@ -106,4 +106,31 @@ describe Vagrant::Action::Builtin::HandleBox do
|
||||||
subject.call(env)
|
subject.call(env)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with a box with a checksum set" do
|
||||||
|
before do
|
||||||
|
machine.stub(box: nil)
|
||||||
|
|
||||||
|
machine.config.vm.box = "foo"
|
||||||
|
machine.config.vm.box_url = "bar"
|
||||||
|
machine.config.vm.box_download_checksum_type = "sha256"
|
||||||
|
machine.config.vm.box_download_checksum = "1f42ac2decf0169c4af02b2d8c77143ce35f7ba87d5d844e19bf7cbb34fbe74e"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "adds a box that doesn't exist and maps checksum options correctly" do
|
||||||
|
expect(action_runner).to receive(:run).with { |action, opts|
|
||||||
|
expect(opts[:box_name]).to eq(machine.config.vm.box)
|
||||||
|
expect(opts[:box_url]).to eq(machine.config.vm.box_url)
|
||||||
|
expect(opts[:box_provider]).to eq(:dummy)
|
||||||
|
expect(opts[:box_version]).to eq(machine.config.vm.box_version)
|
||||||
|
expect(opts[:box_checksum_type]).to eq(machine.config.vm.box_download_checksum_type)
|
||||||
|
expect(opts[:box_checksum]).to eq(machine.config.vm.box_download_checksum)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(app).to receive(:call).with(env)
|
||||||
|
|
||||||
|
subject.call(env)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency "rest-client", ">= 1.6.0", "< 2.0"
|
s.add_dependency "rest-client", ">= 1.6.0", "< 2.0"
|
||||||
s.add_dependency "wdm", "~> 0.1.0"
|
s.add_dependency "wdm", "~> 0.1.0"
|
||||||
s.add_dependency "winrm", "~> 1.3"
|
s.add_dependency "winrm", "~> 1.3"
|
||||||
|
s.add_dependency "winrm-fs", "~> 0.1.0"
|
||||||
|
|
||||||
# We lock this down to avoid compilation issues.
|
# We lock this down to avoid compilation issues.
|
||||||
s.add_dependency "nokogiri", "= 1.6.3.1"
|
s.add_dependency "nokogiri", "= 1.6.3.1"
|
||||||
|
|
|
@ -59,13 +59,6 @@ set :markdown, fenced_code_blocks: true
|
||||||
configure :build do
|
configure :build do
|
||||||
activate :asset_hash
|
activate :asset_hash
|
||||||
activate :minify_css
|
activate :minify_css
|
||||||
activate :minify_html do |html|
|
|
||||||
html.remove_quotes = false
|
|
||||||
html.remove_script_attributes = false
|
|
||||||
html.remove_multi_spaces = false
|
|
||||||
html.remove_http_protocol = false
|
|
||||||
html.remove_https_protocol = false
|
|
||||||
end
|
|
||||||
activate :minify_javascript
|
activate :minify_javascript
|
||||||
|
|
||||||
# Enable cache buster
|
# Enable cache buster
|
||||||
|
|
|
@ -22,3 +22,8 @@ accepts.
|
||||||
In depth documentation and use cases of various Vagrant commands is
|
In depth documentation and use cases of various Vagrant commands is
|
||||||
available by reading the appropriate sub-section available in the left
|
available by reading the appropriate sub-section available in the left
|
||||||
navigational area of this site.
|
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.
|
||||||
|
|
|
@ -5,8 +5,8 @@ sidebar_current: "gettingstarted-projectsetup"
|
||||||
|
|
||||||
# Project Setup
|
# Project Setup
|
||||||
|
|
||||||
The first step for any project to use Vagrant is to configure Vagrant
|
The first step in configuring any Vagrant project is to create a
|
||||||
using a [Vagrantfile](/v2/vagrantfile/index.html). The purpose of the
|
[Vagrantfile](/v2/vagrantfile/index.html). The purpose of the
|
||||||
Vagrantfile is twofold:
|
Vagrantfile is twofold:
|
||||||
|
|
||||||
1. Mark the root directory of your project. A lot of the configuration
|
1. Mark the root directory of your project. A lot of the configuration
|
||||||
|
|
|
@ -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
|
configure and control it in a global way. This page lists those environmental
|
||||||
variables.
|
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
|
||||||
|
|
||||||
`VAGRANT_CWD` can be set to change the working directory of Vagrant. By
|
`VAGRANT_CWD` can be set to change the working directory of Vagrant. By
|
||||||
|
|
|
@ -136,6 +136,16 @@ that the external path has the proper extension (".bat" or ".ps1"), because
|
||||||
Windows uses this to determine what kind fo file it is to execute. If you
|
Windows uses this to determine what kind fo file it is to execute. If you
|
||||||
exclude this extension, it likely won't work.
|
exclude this extension, it likely won't work.
|
||||||
|
|
||||||
|
To run a script already available on the guest you can use an inline script to
|
||||||
|
invoke the remote script on the guest.
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.provision "shell",
|
||||||
|
inline: "/bin/sh /path/to/the/script/already/on/the/guest.sh"
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
## Script Arguments
|
## Script Arguments
|
||||||
|
|
||||||
You can parameterize your scripts as well like any normal shell script.
|
You can parameterize your scripts as well like any normal shell script.
|
||||||
|
|
|
@ -27,9 +27,10 @@ if it doesn't exist.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
As an optional third parameter to configuring synced folders, you may specify
|
You may also specify additional optional parameters when configuring
|
||||||
some options. These options are listed below. More detailed examples of using
|
synced folders. These options are listed below. More detailed examples of using
|
||||||
some of these options are shown below this section.
|
some of these options are shown below this section, note the owner/group example
|
||||||
|
supplies two additional options separated by commas.
|
||||||
|
|
||||||
In addition to these options, the specific synced folder type might
|
In addition to these options, the specific synced folder type might
|
||||||
allow more options. See the documentation for your specific synced folder
|
allow more options. See the documentation for your specific synced folder
|
||||||
|
|
|
@ -15,10 +15,29 @@ Fusion, and `vmware_workstation` for VMware Workstation.
|
||||||
The Vagrant VMware provider does not support parallel execution at this time.
|
The Vagrant VMware provider does not support parallel execution at this time.
|
||||||
Specifying the `--parallel` option will have no effect.
|
Specifying the `--parallel` option will have no effect.
|
||||||
|
|
||||||
<p>
|
To get started, create a new `Vagrantfile` that points to a VMware box:
|
||||||
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>
|
```ruby
|
||||||
</p>
|
# 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">
|
<div class="alert alert-info">
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -33,12 +33,5 @@ end
|
||||||
configure :build do
|
configure :build do
|
||||||
activate :asset_hash
|
activate :asset_hash
|
||||||
activate :minify_css
|
activate :minify_css
|
||||||
activate :minify_html do |html|
|
|
||||||
html.remove_quotes = false
|
|
||||||
html.remove_script_attributes = false
|
|
||||||
html.remove_multi_spaces = false
|
|
||||||
html.remove_http_protocol = false
|
|
||||||
html.remove_https_protocol = false
|
|
||||||
end
|
|
||||||
activate :minify_javascript
|
activate :minify_javascript
|
||||||
end
|
end
|
||||||
|
|
|
@ -177,7 +177,7 @@ page_title: "VMware Vagrant Environments"
|
||||||
software, which must be purchased separately. If you're buying over 100 licenses, contact <a href="mailto:sales@hashicorp.com">sales@hashicorp.com</a> for volume pricing.
|
software, which must be purchased separately. If you're buying over 100 licenses, contact <a href="mailto:sales@hashicorp.com">sales@hashicorp.com</a> for volume pricing.
|
||||||
</div>
|
</div>
|
||||||
<div class="subtext">
|
<div class="subtext">
|
||||||
Previous plugin versions may not support the latest VMware products. Please visit <a href="http://license.hashicorp.com/upgrade/vmware<%= Time.now.year %>">the license upgrade center</a> to check if your license requires an upgrade before you upgrade your VMware products.
|
Previous plugin versions may not support the latest VMware products. Please visit <a href="http://license.hashicorp.com/upgrade/vmware2014">the license upgrade center</a> to check if your license requires an upgrade before you upgrade your VMware products.
|
||||||
</div>
|
</div>
|
||||||
<div class="subtext">
|
<div class="subtext">
|
||||||
For reseller information, <a href="/vmware/reseller.html">click here</a>.
|
For reseller information, <a href="/vmware/reseller.html">click here</a>.
|
||||||
|
|
Loading…
Reference in New Issue