vagrant-unbundled 2.0.3.0 → 2.0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -10
- data/Gemfile.lock +16 -2
- data/README.md +1 -0
- data/bin/vagrant +1 -1
- data/lib/vagrant/action/builtin/handle_box.rb +1 -1
- data/lib/vagrant/action/general/package.rb +1 -1
- data/lib/vagrant/action.rb +3 -1
- data/lib/vagrant/alias.rb +56 -0
- data/lib/vagrant/bundler.rb +1 -1
- data/lib/vagrant/capability_host.rb +1 -1
- data/lib/vagrant/cli.rb +8 -0
- data/lib/vagrant/config/version_base.rb +1 -1
- data/lib/vagrant/environment.rb +7 -1
- data/lib/vagrant/errors.rb +4 -0
- data/lib/vagrant/host.rb +1 -1
- data/lib/vagrant/machine.rb +1 -1
- data/lib/vagrant/machine_index.rb +1 -1
- data/lib/vagrant/plugin/v1/guest.rb +1 -1
- data/lib/vagrant/plugin/v1/host.rb +1 -1
- data/lib/vagrant/plugin/v1/plugin.rb +1 -1
- data/lib/vagrant/plugin/v1/provider.rb +1 -1
- data/lib/vagrant/plugin/v2/guest.rb +1 -1
- data/lib/vagrant/plugin/v2/host.rb +1 -1
- data/lib/vagrant/plugin/v2/plugin.rb +1 -1
- data/lib/vagrant/plugin/v2/provider.rb +1 -1
- data/lib/vagrant/shared_helpers.rb +30 -9
- data/lib/vagrant/util/checkpoint_client.rb +8 -0
- data/lib/vagrant/util/downloader.rb +1 -1
- data/lib/vagrant/util/platform.rb +11 -3
- data/lib/vagrant/util/powershell.rb +17 -1
- data/lib/vagrant/util/safe_exec.rb +1 -1
- data/lib/vagrant/util/ssh.rb +4 -1
- data/lib/vagrant/util/stacked_proc_runner.rb +1 -1
- data/lib/vagrant/util/template_renderer.rb +2 -2
- data/lib/vagrant/vagrantfile.rb +1 -1
- data/lib/vagrant.rb +8 -0
- data/plugins/commands/plugin/gem_helper.rb +1 -1
- data/plugins/commands/powershell/command.rb +2 -2
- data/plugins/commands/powershell/scripts/enable_psremoting.ps1 +1 -1
- data/plugins/communicators/ssh/communicator.rb +10 -1
- data/plugins/communicators/winrm/command_filters/mkdir.rb +4 -2
- data/plugins/communicators/winrm/command_filters/rm.rb +5 -3
- data/plugins/communicators/winrm/command_filters/test.rb +3 -1
- data/plugins/communicators/winrm/command_filters/which.rb +4 -2
- data/plugins/communicators/winrm/communicator.rb +3 -3
- data/plugins/guests/amazon/cap/flavor.rb +1 -1
- data/plugins/guests/coreos/cap/configure_networks.rb +1 -1
- data/plugins/guests/coreos/guest.rb +1 -1
- data/plugins/guests/debian/cap/configure_networks.rb +1 -1
- data/plugins/guests/freebsd/cap/configure_networks.rb +1 -1
- data/plugins/guests/photon/guest.rb +1 -1
- data/plugins/guests/windows/cap/change_host_name.rb +6 -1
- data/plugins/guests/windows/cap/mount_shared_folder.rb +1 -1
- data/plugins/hosts/alt/plugin.rb +1 -1
- data/plugins/hosts/arch/plugin.rb +1 -1
- data/plugins/hosts/gentoo/plugin.rb +1 -1
- data/plugins/hosts/linux/plugin.rb +1 -1
- data/plugins/hosts/redhat/plugin.rb +1 -1
- data/plugins/hosts/slackware/plugin.rb +2 -2
- data/plugins/kernel_v2/config/push.rb +1 -1
- data/plugins/kernel_v2/config/vm.rb +1 -1
- data/plugins/providers/docker/action/compare_synced_folders.rb +1 -1
- data/plugins/providers/virtualbox/action/network.rb +9 -5
- data/plugins/providers/virtualbox/action/network_fix_ipv6.rb +1 -1
- data/plugins/provisioners/chef/config/chef_zero.rb +1 -1
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +2 -2
- data/plugins/provisioners/chef/provisioner/chef_zero.rb +3 -3
- data/plugins/provisioners/puppet/config/puppet.rb +2 -0
- data/plugins/provisioners/puppet/provisioner/puppet.rb +18 -1
- data/plugins/provisioners/salt/config.rb +6 -0
- data/plugins/provisioners/salt/provisioner.rb +11 -1
- data/templates/locales/command_ps.yml +1 -1
- data/templates/locales/en.yml +13 -4
- data/templates/locales/guest_windows.yml +1 -1
- data/templates/locales/providers_docker.yml +1 -1
- data/templates/locales/synced_folder_smb.yml +2 -2
- data/vagrant.gemspec +2 -0
- data/vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.document +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.gitignore +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.travis.yml +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/CHANGELOG.md +209 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/Gemfile +4 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/LICENSE.txt +78 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/README.md +67 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/Rakefile +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/data/public_suffix_list.dat +12440 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/domain_name.gemspec +36 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/etld_data.rb +8474 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/etld_data.rb.erb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/punycode.rb +283 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/version.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name.rb +297 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/helper.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/test_domain_name-punycode.rb +97 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/test_domain_name.rb +317 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/tool/gen_etld_data.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/CHANGES +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/LICENSE +201 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/MANIFEST +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/README +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/Rakefile +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/ffi-win32-extensions.gemspec +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/lib/ffi/win32/extensions.rb +96 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/lib/ffi-win32-extensions.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/test/test_ffi_extensions.rb +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/test/test_string_extensions.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/CHANGES +235 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/MANIFEST +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/README +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/Rakefile +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/appveyor.yml +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/constants.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/functions.rb +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/structs.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file.rb +585 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32-file.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_link.rb +141 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_misc.rb +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_path.rb +282 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_stat.rb +330 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/win32-file.gemspec +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/CHANGES +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/MANIFEST +18 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/README +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/Rakefile +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/appveyor.yml +53 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/constants.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/functions.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/structs.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security.rb +963 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32-file-security.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_acls.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_constants.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_encryption.rb +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ffi.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ownership.rb +174 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_permissions.rb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_version.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/win32-file-security.gemspec +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/CHANGES +169 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/MANIFEST +12 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/README +94 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/Rakefile +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/appveyor.yml +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/stat.rb +1008 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/constants.rb +94 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/functions.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/structs.rb +196 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32-file-stat.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/test/test_file_stat.rb +677 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/win32-file-stat.gemspec +30 -0
- data/vendor/bundle/ruby/2.5.0/specifications/domain_name-0.5.20180417.gemspec +46 -0
- data/vendor/bundle/ruby/2.5.0/specifications/ffi-win32-extensions-1.0.3.gemspec +38 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-0.8.1.gemspec +51 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-security-1.0.10.gemspec +47 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-stat-1.5.5.gemspec +48 -0
- data/version.txt +1 -1
- metadata +114 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
module Vagrant
|
2
2
|
module Util
|
3
|
-
# This module
|
3
|
+
# This module provides a `safe_exec` method which is a drop-in
|
4
4
|
# replacement for `Kernel.exec` which addresses a specific issue
|
5
5
|
# which manifests on OS X 10.5 (GH-51) and perhaps other operating systems.
|
6
6
|
# This issue causes `exec` to fail if there is more than one system
|
data/lib/vagrant/util/ssh.rb
CHANGED
@@ -68,7 +68,10 @@ module Vagrant
|
|
68
68
|
# include ssh, notably git, mingw and cygwin, but make sure ssh is in the path!
|
69
69
|
|
70
70
|
# First try using the original path provided
|
71
|
-
|
71
|
+
if ENV["VAGRANT_PREFER_SYSTEM_BIN"] != "0"
|
72
|
+
ssh_path = Which.which("ssh", original_path: true)
|
73
|
+
end
|
74
|
+
|
72
75
|
# If we didn't find an ssh executable, see if we shipped one
|
73
76
|
if !ssh_path
|
74
77
|
ssh_path = Which.which("ssh")
|
@@ -23,7 +23,7 @@ module Vagrant
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# Executes all the procs on the stack, passing in the given arguments.
|
26
|
-
# The stack is not cleared
|
26
|
+
# The stack is not cleared afterwards. It is up to the user of this
|
27
27
|
# mixin to clear the stack by calling `proc_stack.clear`.
|
28
28
|
def run_procs!(*args)
|
29
29
|
proc_stack.each do |proc|
|
@@ -50,7 +50,7 @@ module Vagrant
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
# Renders the template using the class
|
53
|
+
# Renders the template using the class instance as the binding. Because the
|
54
54
|
# renderer inherits from `OpenStruct`, additional view variables can be
|
55
55
|
# added like normal accessors.
|
56
56
|
#
|
@@ -76,7 +76,7 @@ module Vagrant
|
|
76
76
|
Erubis::Eruby.new(template, trim: true).result(binding)
|
77
77
|
end
|
78
78
|
|
79
|
-
# Returns the full path to the template, taking into
|
79
|
+
# Returns the full path to the template, taking into account the gem directory
|
80
80
|
# and adding the `.erb` extension to the end.
|
81
81
|
#
|
82
82
|
# @return [String]
|
data/lib/vagrant/vagrantfile.rb
CHANGED
@@ -18,7 +18,7 @@ module Vagrant
|
|
18
18
|
# Initializes by loading a Vagrantfile.
|
19
19
|
#
|
20
20
|
# @param [Config::Loader] loader Configuration loader that should
|
21
|
-
# already be configured with the proper
|
21
|
+
# already be configured with the proper Vagrantfile locations.
|
22
22
|
# This usually comes from {Vagrant::Environment}
|
23
23
|
# @param [Array<Symbol>] keys The Vagrantfiles to load and the
|
24
24
|
# order to load them in (keys within the loader).
|
data/lib/vagrant.rb
CHANGED
@@ -65,9 +65,16 @@ require 'i18n'
|
|
65
65
|
# there are issues with ciphers not being properly loaded.
|
66
66
|
require 'openssl'
|
67
67
|
|
68
|
+
# If we are on Windows, load in File helpers
|
69
|
+
if Vagrant::Util::Platform.windows?
|
70
|
+
require "ffi-win32-extensions"
|
71
|
+
require "win32/file/security"
|
72
|
+
end
|
73
|
+
|
68
74
|
# Always make the version available
|
69
75
|
require 'vagrant/version'
|
70
76
|
global_logger = Log4r::Logger.new("vagrant::global")
|
77
|
+
Vagrant.global_logger = global_logger
|
71
78
|
global_logger.info("Vagrant version: #{Vagrant::VERSION}")
|
72
79
|
global_logger.info("Ruby version: #{RUBY_VERSION}")
|
73
80
|
global_logger.info("RubyGems version: #{Gem::VERSION}")
|
@@ -83,6 +90,7 @@ require "vagrant/registry"
|
|
83
90
|
|
84
91
|
module Vagrant
|
85
92
|
autoload :Action, 'vagrant/action'
|
93
|
+
autoload :Alias, 'vagrant/alias'
|
86
94
|
autoload :BatchAction, 'vagrant/batch_action'
|
87
95
|
autoload :Box, 'vagrant/box'
|
88
96
|
autoload :BoxCollection, 'vagrant/box_collection'
|
@@ -64,7 +64,7 @@ module VagrantPlugins
|
|
64
64
|
Gem.sources = old_sources.to_a
|
65
65
|
end
|
66
66
|
|
67
|
-
# This is pretty hacky but it is a custom
|
67
|
+
# This is pretty hacky but it is a custom implementation of
|
68
68
|
# Gem::ConfigFile so that we don't load any gemrc files.
|
69
69
|
class NilGemConfig < Gem::ConfigFile
|
70
70
|
def initialize
|
@@ -55,7 +55,7 @@ module VagrantPlugins
|
|
55
55
|
machine.ui.detail(data) if type == :stdout
|
56
56
|
end
|
57
57
|
if out_code == 0
|
58
|
-
machine.ui.success("Command: #{options[:command]} executed
|
58
|
+
machine.ui.success("Command: #{options[:command]} executed successfully with output code #{out_code}.")
|
59
59
|
end
|
60
60
|
next
|
61
61
|
end
|
@@ -103,7 +103,7 @@ module VagrantPlugins
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def reset_ps_remoting_for(machine, ps_info)
|
106
|
-
machine.ui.output(I18n.t("vagrant_ps.
|
106
|
+
machine.ui.output(I18n.t("vagrant_ps.resetting"))
|
107
107
|
script_path = File.expand_path("../scripts/reset_trustedhosts.ps1", __FILE__)
|
108
108
|
args = []
|
109
109
|
args << "-hostname" << ps_info[:host]
|
@@ -5,7 +5,7 @@ Param(
|
|
5
5
|
[string]$password
|
6
6
|
)
|
7
7
|
# If we are in this script, we know basic winrm is working
|
8
|
-
# If the user is not using a domain
|
8
|
+
# If the user is not using a domain account and chances are
|
9
9
|
# they are not, PS Remoting will not work if the guest is not
|
10
10
|
# listed in the trusted hosts.
|
11
11
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'etc'
|
1
2
|
require 'logger'
|
2
3
|
require 'pathname'
|
3
4
|
require 'stringio'
|
@@ -193,6 +194,14 @@ module VagrantPlugins
|
|
193
194
|
f.write(priv)
|
194
195
|
end
|
195
196
|
|
197
|
+
# Adjust private key file permissions
|
198
|
+
if Vagrant::Util::Platform.windows?
|
199
|
+
priv_path = @machine.data_dir.join("private_key").to_s
|
200
|
+
File.set_permissions(priv_path, Etc.getlogin => File::FULL)
|
201
|
+
else
|
202
|
+
@machine.data_dir.join("private_key").chmod(0600)
|
203
|
+
end
|
204
|
+
|
196
205
|
# Remove the old key if it exists
|
197
206
|
@machine.ui.detail(I18n.t("vagrant.inserting_remove_key"))
|
198
207
|
@machine.guest.capability(
|
@@ -285,7 +294,7 @@ module VagrantPlugins
|
|
285
294
|
|
286
295
|
scp_connect do |scp|
|
287
296
|
if File.directory?(from)
|
288
|
-
#
|
297
|
+
# Recursively upload directories
|
289
298
|
scp.upload!(from, to, recursive: true)
|
290
299
|
else
|
291
300
|
# Open file read only to fix issue [GH-1036]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
module VagrantPlugins
|
2
4
|
module CommunicatorWinRM
|
3
5
|
module CommandFilters
|
@@ -6,14 +8,14 @@ module VagrantPlugins
|
|
6
8
|
def filter(command)
|
7
9
|
# mkdir -p /some/dir
|
8
10
|
# mkdir /some/dir
|
9
|
-
cmd_parts = command.strip
|
11
|
+
cmd_parts = Shellwords.split(command.strip)
|
10
12
|
dir = cmd_parts.pop
|
11
13
|
while !dir.nil? && dir.start_with?('-')
|
12
14
|
dir = cmd_parts.pop
|
13
15
|
end
|
14
16
|
# This will ignore any -p switches, which are redundant in PowerShell,
|
15
17
|
# and ambiguous in PowerShell 4+
|
16
|
-
return "mkdir #{dir} -force"
|
18
|
+
return "mkdir \"#{dir}\" -force"
|
17
19
|
end
|
18
20
|
|
19
21
|
def accept?(command)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
module VagrantPlugins
|
2
4
|
module CommunicatorWinRM
|
3
5
|
module CommandFilters
|
@@ -9,7 +11,7 @@ module VagrantPlugins
|
|
9
11
|
# rm -R -f /some/dir
|
10
12
|
# rm -f /some/dir
|
11
13
|
# rm /some/dir
|
12
|
-
cmd_parts = command.strip
|
14
|
+
cmd_parts = Shellwords.split(command.strip)
|
13
15
|
|
14
16
|
# Figure out if we need to do this recursively
|
15
17
|
recurse = false
|
@@ -29,9 +31,9 @@ module VagrantPlugins
|
|
29
31
|
|
30
32
|
ret_cmd = ''
|
31
33
|
if recurse
|
32
|
-
ret_cmd = "rm #{dir} -recurse -force"
|
34
|
+
ret_cmd = "rm \"#{dir}\" -recurse -force"
|
33
35
|
else
|
34
|
-
ret_cmd = "rm #{dir} -force"
|
36
|
+
ret_cmd = "rm \"#{dir}\" -force"
|
35
37
|
end
|
36
38
|
return ret_cmd
|
37
39
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
module VagrantPlugins
|
2
4
|
module CommunicatorWinRM
|
3
5
|
module CommandFilters
|
@@ -9,7 +11,7 @@ module VagrantPlugins
|
|
9
11
|
# test -L /somelink
|
10
12
|
# test -x /tmp/some.exe
|
11
13
|
|
12
|
-
cmd_parts = command.strip
|
14
|
+
cmd_parts = Shellwords.split(command.strip)
|
13
15
|
flag = cmd_parts[1]
|
14
16
|
path = cmd_parts[2]
|
15
17
|
|
@@ -1,12 +1,14 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
module VagrantPlugins
|
2
4
|
module CommunicatorWinRM
|
3
5
|
module CommandFilters
|
4
6
|
# Converts a *nix 'which' command to a PowerShell equivalent
|
5
7
|
class Which
|
6
8
|
def filter(command)
|
7
|
-
executable = command.strip
|
9
|
+
executable = Shellwords.split(command.strip)[1]
|
8
10
|
return <<-EOH
|
9
|
-
$command = [Array](Get-Command #{executable} -errorAction SilentlyContinue)
|
11
|
+
$command = [Array](Get-Command "#{executable}" -errorAction SilentlyContinue)
|
10
12
|
if ($null -eq $command) { exit 1 }
|
11
13
|
write-host $command[0].Definition
|
12
14
|
exit 0
|
@@ -74,7 +74,7 @@ module VagrantPlugins
|
|
74
74
|
rescue Errors::NoRoute
|
75
75
|
message = "Host unreachable."
|
76
76
|
rescue Errors::TransientError => e
|
77
|
-
# Any other
|
77
|
+
# Any other retryable errors
|
78
78
|
message = e.message
|
79
79
|
end
|
80
80
|
|
@@ -127,7 +127,7 @@ module VagrantPlugins
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def execute(command, opts={}, &block)
|
130
|
-
# If this is a *nix command with no Windows
|
130
|
+
# If this is a *nix command with no Windows equivalent, don't run it
|
131
131
|
command = @cmd_filter.filter(command)
|
132
132
|
return 0 if command.empty?
|
133
133
|
|
@@ -152,7 +152,7 @@ module VagrantPlugins
|
|
152
152
|
|
153
153
|
def test(command, opts=nil)
|
154
154
|
# If this is a *nix command (which we know about) with no Windows
|
155
|
-
#
|
155
|
+
# equivalent, assume failure
|
156
156
|
command = @cmd_filter.filter(command)
|
157
157
|
return false if command.empty?
|
158
158
|
|
@@ -4,7 +4,7 @@ module VagrantPlugins
|
|
4
4
|
class Flavor
|
5
5
|
def self.flavor(machine)
|
6
6
|
# Amazon AMI is a frankenstien RHEL, mainly based on 6
|
7
|
-
# Maybe in the future if they
|
7
|
+
# Maybe in the future if they incorporate RHEL 7 elements
|
8
8
|
# this should be extended to read /etc/os-release or similar
|
9
9
|
return :rhel
|
10
10
|
end
|
@@ -48,7 +48,7 @@ module VagrantPlugins
|
|
48
48
|
commands << "systemctl stop etcd"
|
49
49
|
|
50
50
|
# Configure interfaces
|
51
|
-
# FIXME: fix matching of interfaces with IP
|
51
|
+
# FIXME: fix matching of interfaces with IP addresses
|
52
52
|
networks.each do |network|
|
53
53
|
iface = interfaces[network[:interface].to_i]
|
54
54
|
commands << "ifconfig #{iface} #{network[:ip]} netmask #{network[:netmask]}".squeeze(" ")
|
@@ -4,7 +4,7 @@ module VagrantPlugins
|
|
4
4
|
module GuestCoreOS
|
5
5
|
class Guest < Vagrant.plugin("2", :guest)
|
6
6
|
def detect?(machine)
|
7
|
-
machine.communicate.test("cat /etc/os-release | grep ID=coreos")
|
7
|
+
machine.communicate.test("(cat /etc/os-release | grep ID=coreos) || (cat /etc/os-release | grep -E 'ID_LIKE=.*coreos.*')")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -61,7 +61,7 @@ module VagrantPlugins
|
|
61
61
|
"renderer" => NETPLAN_DEFAULT_RENDERER, "ethernets" => ethernets}}
|
62
62
|
|
63
63
|
remote_path = upload_tmp_file(comm, np_config.to_yaml)
|
64
|
-
dest_path = "#{NETPLAN_DIRECTORY}/
|
64
|
+
dest_path = "#{NETPLAN_DIRECTORY}/50-vagrant.yaml"
|
65
65
|
comm.sudo(["mv -f '#{remote_path}' '#{dest_path}'",
|
66
66
|
"chown root:root '#{dest_path}'",
|
67
67
|
"chmod 0644 '#{dest_path}'",
|
@@ -16,7 +16,7 @@ module VagrantPlugins
|
|
16
16
|
interfaces = []
|
17
17
|
|
18
18
|
# Remove any previous network additions to the configuration file.
|
19
|
-
commands << "sed -i'' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf"
|
19
|
+
commands << "sed -i '' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf"
|
20
20
|
|
21
21
|
comm.sudo("ifconfig -a | grep -o '^[0-9a-z]*' | grep -v '^lo'", options) do |_, stdout|
|
22
22
|
interfaces = stdout.split("\n")
|
@@ -2,7 +2,7 @@ module VagrantPlugins
|
|
2
2
|
module GuestPhoton
|
3
3
|
class Guest < Vagrant.plugin("2", :guest)
|
4
4
|
def detect?(machine)
|
5
|
-
machine.communicate.test("cat /etc/photon-release | grep 'VMware Photon
|
5
|
+
machine.communicate.test("cat /etc/photon-release | grep 'VMware Photon'")
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
@@ -28,7 +28,12 @@ module VagrantPlugins
|
|
28
28
|
error_key: :rename_computer_failed)
|
29
29
|
|
30
30
|
# Don't continue until the machine has shutdown and rebooted
|
31
|
-
|
31
|
+
if machine.guest.capability?(:wait_for_reboot)
|
32
|
+
machine.guest.capability(:wait_for_reboot)
|
33
|
+
else
|
34
|
+
# use graceful_halt_timeout only if guest cannot wait for reboot
|
35
|
+
sleep(sleep_timeout)
|
36
|
+
end
|
32
37
|
end
|
33
38
|
end
|
34
39
|
end
|
@@ -6,7 +6,7 @@ module VagrantPlugins
|
|
6
6
|
module Cap
|
7
7
|
class MountSharedFolder
|
8
8
|
def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
|
9
|
-
mount_shared_folder(machine, name, guestpath, "\\\\
|
9
|
+
mount_shared_folder(machine, name, guestpath, "\\\\vboxsvr\\")
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.mount_vmware_shared_folder(machine, name, guestpath, options)
|
data/plugins/hosts/alt/plugin.rb
CHANGED
@@ -4,7 +4,7 @@ module VagrantPlugins
|
|
4
4
|
module HostSlackware
|
5
5
|
class Plugin < Vagrant.plugin("2")
|
6
6
|
name "Slackware host"
|
7
|
-
description "Slackware and
|
7
|
+
description "Slackware and derivatives host support."
|
8
8
|
|
9
9
|
host("slackware", "linux") do
|
10
10
|
require File.expand_path("../host", __FILE__)
|
@@ -12,7 +12,7 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Linux-specific helpers we need to determine paths that can
|
15
|
-
# be
|
15
|
+
# be overridden.
|
16
16
|
host_capability("slackware", "nfs_check_command") do
|
17
17
|
require_relative "cap/nfs"
|
18
18
|
Cap::NFS
|
@@ -35,7 +35,7 @@ module VagrantPlugins
|
|
35
35
|
|
36
36
|
begin
|
37
37
|
tuples.each do |s, b|
|
38
|
-
# Update the strategy if it has changed,
|
38
|
+
# Update the strategy if it has changed, resetting the current
|
39
39
|
# config object.
|
40
40
|
if s != strategy
|
41
41
|
@logger.warn("duplicate strategy defined, overwriting config")
|
@@ -535,7 +535,7 @@ module VagrantPlugins
|
|
535
535
|
@__finalized = true
|
536
536
|
end
|
537
537
|
|
538
|
-
# This returns the compiled provider-specific
|
538
|
+
# This returns the compiled provider-specific configuration for the
|
539
539
|
# given provider.
|
540
540
|
#
|
541
541
|
# @param [Symbol] name Name of the provider.
|
@@ -180,15 +180,15 @@ module VagrantPlugins
|
|
180
180
|
|
181
181
|
# If we still don't have a bridge chosen (this means that one wasn't
|
182
182
|
# specified in the Vagrantfile, or the bridge specified in the Vagrantfile
|
183
|
-
# wasn't found), then we fall back to the normal means of
|
183
|
+
# wasn't found), then we fall back to the normal means of searching for a
|
184
184
|
# bridged network.
|
185
185
|
if !chosen_bridge
|
186
186
|
if bridgedifs.length == 1
|
187
|
-
# One
|
187
|
+
# One bridgeable interface? Just use it.
|
188
188
|
chosen_bridge = bridgedifs[0][:name]
|
189
189
|
@logger.debug("Only one bridged interface available. Using it by default.")
|
190
190
|
else
|
191
|
-
# More than one
|
191
|
+
# More than one bridgeable interface requires a user decision, so
|
192
192
|
# show options to choose from.
|
193
193
|
@env[:ui].info I18n.t(
|
194
194
|
"vagrant.actions.vm.bridged_networking.available",
|
@@ -280,8 +280,12 @@ module VagrantPlugins
|
|
280
280
|
# interface.
|
281
281
|
@env[:machine].provider.driver.read_bridged_interfaces.each do |interface|
|
282
282
|
that_netaddr = network_address(interface[:ip], interface[:netmask])
|
283
|
-
|
284
|
-
|
283
|
+
if netaddr == that_netaddr && interface[:status] != "Down"
|
284
|
+
raise Vagrant::Errors::NetworkCollision,
|
285
|
+
netaddr: netaddr,
|
286
|
+
that_netaddr: that_netaddr,
|
287
|
+
interface_name: interface[:name]
|
288
|
+
end
|
285
289
|
end
|
286
290
|
|
287
291
|
# Split the IP address into its components
|
@@ -10,7 +10,7 @@ module VagrantPlugins
|
|
10
10
|
module ProviderVirtualBox
|
11
11
|
module Action
|
12
12
|
# This middleware works around a bug in VirtualBox where booting
|
13
|
-
# a VM with an IPv6 host-only network will
|
13
|
+
# a VM with an IPv6 host-only network will sometimes lose the
|
14
14
|
# route to that machine.
|
15
15
|
class NetworkFixIPv6
|
16
16
|
include Vagrant::Util::Presence
|
@@ -5,6 +5,7 @@ require "set"
|
|
5
5
|
require "log4r"
|
6
6
|
|
7
7
|
require "vagrant/util/counter"
|
8
|
+
require "vagrant/action/builtin/mixin_synced_folders"
|
8
9
|
|
9
10
|
require_relative "base"
|
10
11
|
|
@@ -95,13 +96,12 @@ module VagrantPlugins
|
|
95
96
|
else
|
96
97
|
# Path already exists on the virtual machine. Expand it
|
97
98
|
# relative to where we're provisioning.
|
98
|
-
remote_path = File.expand_path(path, guest_provisioning_path)
|
99
99
|
|
100
100
|
# Remove drive letter if running on a windows host. This is a bit
|
101
101
|
# of a hack but is the most portable way I can think of at the moment
|
102
102
|
# to achieve this. Otherwise, Vagrant attempts to share at some crazy
|
103
103
|
# path like /home/vagrant/c:/foo/bar
|
104
|
-
remote_path =
|
104
|
+
remote_path = File.expand_path(path.gsub(/^[a-zA-Z]:\//, "/"), guest_provisioning_path.gsub(/^[a-zA-Z]:\//, "/"))
|
105
105
|
end
|
106
106
|
|
107
107
|
# If we have specified a folder name to append then append it
|
@@ -62,11 +62,11 @@ module VagrantPlugins
|
|
62
62
|
local_mode: true,
|
63
63
|
)
|
64
64
|
|
65
|
-
still_active = 259 #provisioner has asked chef to reboot
|
66
|
-
|
65
|
+
still_active = 259 #provisioner has asked chef to reboot
|
66
|
+
|
67
67
|
@config.attempts.times do |attempt|
|
68
68
|
exit_status = 0
|
69
|
-
while exit_status == 0 || exit_status == still_active
|
69
|
+
while exit_status == 0 || exit_status == still_active
|
70
70
|
if @machine.guest.capability?(:wait_for_reboot)
|
71
71
|
@machine.guest.capability(:wait_for_reboot)
|
72
72
|
elsif attempt > 0
|
@@ -8,6 +8,7 @@ module VagrantPlugins
|
|
8
8
|
attr_accessor :binary_path
|
9
9
|
|
10
10
|
attr_accessor :facter
|
11
|
+
attr_accessor :structured_facts
|
11
12
|
attr_accessor :hiera_config_path
|
12
13
|
attr_accessor :manifest_file
|
13
14
|
attr_accessor :manifests_path
|
@@ -37,6 +38,7 @@ module VagrantPlugins
|
|
37
38
|
@synced_folder_type = UNSET_VALUE
|
38
39
|
@temp_dir = UNSET_VALUE
|
39
40
|
@working_directory = UNSET_VALUE
|
41
|
+
@structured_facts = UNSET_VALUE
|
40
42
|
end
|
41
43
|
|
42
44
|
def nfs=(value)
|
@@ -132,6 +132,22 @@ module VagrantPlugins
|
|
132
132
|
@machine.communicate.upload(local_hiera_path, @hiera_config_path)
|
133
133
|
end
|
134
134
|
|
135
|
+
# Build up the structured custom facts if we have any
|
136
|
+
# With structured facts on, we assume the config.facter is yaml.
|
137
|
+
if config.structured_facts && !config.facter.empty?
|
138
|
+
@facter_config_path = "/etc/puppetlabs/facter/facts.d/vagrant_facts.yaml"
|
139
|
+
if windows?
|
140
|
+
@facter_config_path = "/ProgramData/PuppetLabs/facter/facts.d/vagrant_facts.yaml"
|
141
|
+
end
|
142
|
+
t = Tempfile.new("vagrant_facts.yaml")
|
143
|
+
t.write(config.facter.to_yaml)
|
144
|
+
t.close()
|
145
|
+
@machine.communicate.tap do |comm|
|
146
|
+
comm.upload(t.path, File.join(@config.temp_dir, "vagrant_facts.yaml"))
|
147
|
+
comm.sudo("cp #{config.temp_dir}/vagrant_facts.yaml #{@facter_config_path}")
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
135
151
|
run_puppet_apply
|
136
152
|
end
|
137
153
|
|
@@ -213,7 +229,8 @@ module VagrantPlugins
|
|
213
229
|
|
214
230
|
# Build up the custom facts if we have any
|
215
231
|
facter = nil
|
216
|
-
if
|
232
|
+
# Build up the (non-structured) custom facts if we have any
|
233
|
+
if !config.structured_facts && !config.facter.empty?
|
217
234
|
facts = []
|
218
235
|
config.facter.each do |key, value|
|
219
236
|
facts << "FACTER_#{key}='#{value}'"
|
@@ -6,9 +6,11 @@ module VagrantPlugins
|
|
6
6
|
class Config < Vagrant.plugin("2", :config)
|
7
7
|
## salty-vagrant options
|
8
8
|
attr_accessor :minion_config
|
9
|
+
attr_accessor :minion_json_config
|
9
10
|
attr_accessor :minion_key
|
10
11
|
attr_accessor :minion_pub
|
11
12
|
attr_accessor :master_config
|
13
|
+
attr_accessor :master_json_config
|
12
14
|
attr_accessor :master_key
|
13
15
|
attr_accessor :master_pub
|
14
16
|
attr_accessor :grains_config
|
@@ -42,9 +44,11 @@ module VagrantPlugins
|
|
42
44
|
|
43
45
|
def initialize
|
44
46
|
@minion_config = UNSET_VALUE
|
47
|
+
@minion_json_config = UNSET_VALUE
|
45
48
|
@minion_key = UNSET_VALUE
|
46
49
|
@minion_pub = UNSET_VALUE
|
47
50
|
@master_config = UNSET_VALUE
|
51
|
+
@master_json_config = UNSET_VALUE
|
48
52
|
@master_key = UNSET_VALUE
|
49
53
|
@master_pub = UNSET_VALUE
|
50
54
|
@grains_config = UNSET_VALUE
|
@@ -100,6 +104,8 @@ module VagrantPlugins
|
|
100
104
|
@master_id = nil if @master_id == UNSET_VALUE
|
101
105
|
@salt_call_args = nil if @salt_call_args == UNSET_VALUE
|
102
106
|
@salt_args = nil if @salt_args == UNSET_VALUE
|
107
|
+
@minion_json_config = nil if @minion_json_config == UNSET_VALUE
|
108
|
+
@master_json_config = nil if @master_json_config == UNSET_VALUE
|
103
109
|
|
104
110
|
# NOTE: Optimistic defaults are set in the provisioner. UNSET_VALUEs
|
105
111
|
# are converted there to allow proper detection of unset values.
|