vagrant-unbundled 1.9.1.1 → 1.9.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/CHANGELOG.md +126 -0
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/bin/vagrant +11 -0
  7. data/contrib/bash/completion.sh +9 -9
  8. data/lib/vagrant.rb +4 -2
  9. data/lib/vagrant/action/builtin/box_add.rb +13 -8
  10. data/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +67 -14
  11. data/lib/vagrant/action/builtin/provision.rb +10 -5
  12. data/lib/vagrant/action/general/package_setup_files.rb +51 -0
  13. data/lib/vagrant/action/general/package_setup_folders.rb +37 -0
  14. data/lib/vagrant/batch_action.rb +4 -2
  15. data/lib/vagrant/box_collection.rb +17 -5
  16. data/lib/vagrant/bundler.rb +110 -12
  17. data/lib/vagrant/cli.rb +1 -1
  18. data/lib/vagrant/environment.rb +4 -4
  19. data/lib/vagrant/errors.rb +32 -0
  20. data/lib/vagrant/shared_helpers.rb +14 -0
  21. data/lib/vagrant/ui.rb +3 -3
  22. data/lib/vagrant/util.rb +7 -1
  23. data/lib/vagrant/util/command_deprecation.rb +56 -0
  24. data/lib/vagrant/util/credential_scrubber.rb +29 -0
  25. data/lib/vagrant/util/guest_inspection.rb +47 -0
  26. data/lib/vagrant/util/platform.rb +217 -27
  27. data/lib/vagrant/util/powershell.rb +25 -0
  28. data/lib/vagrant/util/safe_exec.rb +9 -1
  29. data/lib/vagrant/util/ssh.rb +1 -1
  30. data/lib/vagrant/util/subprocess.rb +21 -2
  31. data/lib/vagrant/util/which.rb +6 -4
  32. data/plugins/commands/box/command/list.rb +1 -1
  33. data/plugins/commands/package/command.rb +3 -2
  34. data/plugins/commands/plugin/action.rb +2 -1
  35. data/plugins/commands/plugin/action/expunge_plugins.rb +20 -5
  36. data/plugins/commands/plugin/action/install_gem.rb +0 -8
  37. data/plugins/commands/plugin/command/expunge.rb +18 -5
  38. data/plugins/commands/plugin/command/mixin_install_opts.rb +1 -4
  39. data/plugins/commands/plugin/gem_helper.rb +5 -1
  40. data/plugins/commands/up/command.rb +1 -1
  41. data/plugins/commands/validate/command.rb +31 -0
  42. data/plugins/commands/validate/plugin.rb +17 -0
  43. data/plugins/communicators/ssh/communicator.rb +50 -25
  44. data/plugins/communicators/winrm/communicator.rb +8 -54
  45. data/plugins/communicators/winrm/config.rb +3 -0
  46. data/plugins/communicators/winrm/helper.rb +1 -1
  47. data/plugins/communicators/winrm/shell.rb +38 -32
  48. data/plugins/communicators/winssh/communicator.rb +161 -0
  49. data/plugins/communicators/winssh/config.rb +30 -0
  50. data/plugins/communicators/winssh/plugin.rb +21 -0
  51. data/plugins/guests/arch/cap/change_host_name.rb +0 -3
  52. data/plugins/guests/arch/cap/configure_networks.rb +1 -1
  53. data/plugins/guests/atomic/cap/change_host_name.rb +0 -3
  54. data/plugins/guests/darwin/cap/change_host_name.rb +0 -4
  55. data/plugins/guests/debian/cap/change_host_name.rb +0 -3
  56. data/plugins/guests/debian/cap/configure_networks.rb +2 -1
  57. data/plugins/guests/elementary/guest.rb +10 -0
  58. data/plugins/guests/elementary/plugin.rb +15 -0
  59. data/plugins/guests/esxi/cap/public_key.rb +63 -0
  60. data/plugins/guests/esxi/plugin.rb +11 -0
  61. data/plugins/guests/freebsd/cap/change_host_name.rb +0 -4
  62. data/plugins/guests/gentoo/cap/change_host_name.rb +7 -5
  63. data/plugins/guests/gentoo/cap/configure_networks.rb +57 -21
  64. data/plugins/guests/linux/cap/mount_smb_shared_folder.rb +20 -53
  65. data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +10 -58
  66. data/plugins/guests/linux/cap/network_interfaces.rb +8 -1
  67. data/plugins/guests/linux/cap/nfs.rb +5 -14
  68. data/plugins/guests/linux/guest.rb +3 -3
  69. data/plugins/guests/omnios/cap/change_host_name.rb +0 -3
  70. data/plugins/guests/openbsd/cap/change_host_name.rb +0 -4
  71. data/plugins/guests/photon/cap/change_host_name.rb +0 -3
  72. data/plugins/guests/pld/cap/change_host_name.rb +0 -3
  73. data/plugins/guests/redhat/cap/change_host_name.rb +2 -9
  74. data/plugins/guests/redhat/cap/configure_networks.rb +43 -21
  75. data/plugins/guests/slackware/cap/change_host_name.rb +0 -3
  76. data/plugins/guests/suse/cap/change_host_name.rb +0 -3
  77. data/plugins/guests/tinycore/cap/mount_nfs.rb +3 -8
  78. data/plugins/guests/windows/cap/configure_networks.rb +0 -4
  79. data/plugins/guests/windows/cap/mount_shared_folder.rb +13 -1
  80. data/plugins/guests/windows/scripts/mount_volume.ps1.erb +1 -1
  81. data/plugins/hosts/windows/cap/ps.rb +6 -1
  82. data/plugins/kernel_v2/config/vm.rb +6 -4
  83. data/plugins/providers/docker/action.rb +4 -7
  84. data/plugins/providers/docker/action/build.rb +1 -1
  85. data/plugins/providers/docker/action/create.rb +3 -0
  86. data/plugins/providers/docker/config.rb +27 -1
  87. data/plugins/providers/docker/driver.rb +15 -2
  88. data/plugins/providers/docker/driver/compose.rb +287 -0
  89. data/plugins/providers/docker/errors.rb +16 -0
  90. data/plugins/providers/docker/provider.rb +25 -10
  91. data/plugins/providers/hyperv/action.rb +33 -8
  92. data/plugins/providers/hyperv/action/export.rb +39 -0
  93. data/plugins/providers/hyperv/action/import.rb +23 -4
  94. data/plugins/providers/hyperv/action/package.rb +16 -0
  95. data/plugins/providers/hyperv/action/package_metadata_json.rb +34 -0
  96. data/plugins/providers/hyperv/action/package_setup_files.rb +16 -0
  97. data/plugins/providers/hyperv/action/package_setup_folders.rb +18 -0
  98. data/plugins/providers/hyperv/action/package_vagrantfile.rb +34 -0
  99. data/plugins/providers/hyperv/config.rb +20 -4
  100. data/plugins/providers/hyperv/driver.rb +12 -0
  101. data/plugins/providers/hyperv/scripts/export_vm.ps1 +15 -0
  102. data/plugins/providers/hyperv/scripts/get_network_mac.ps1 +28 -0
  103. data/plugins/providers/hyperv/scripts/has_vmcx_support.ps1 +11 -0
  104. data/plugins/providers/hyperv/scripts/import_vm_vmcx.ps1 +10 -4
  105. data/plugins/providers/hyperv/scripts/import_vm_xml.ps1 +9 -3
  106. data/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1 +37 -0
  107. data/plugins/providers/virtualbox/action/package_setup_files.rb +7 -42
  108. data/plugins/providers/virtualbox/action/package_setup_folders.rb +6 -26
  109. data/plugins/providers/virtualbox/driver/base.rb +10 -0
  110. data/plugins/providers/virtualbox/driver/version_5_0.rb +11 -11
  111. data/plugins/providers/virtualbox/driver/version_5_1.rb +3 -721
  112. data/plugins/providers/virtualbox/provider.rb +9 -5
  113. data/plugins/providers/virtualbox/synced_folder.rb +1 -1
  114. data/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +3 -1
  115. data/plugins/provisioners/ansible/cap/guest/arch/ansible_install.rb +2 -2
  116. data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +8 -8
  117. data/plugins/provisioners/ansible/cap/guest/fedora/ansible_install.rb +9 -5
  118. data/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install.rb +1 -1
  119. data/plugins/provisioners/ansible/cap/guest/pip/pip.rb +5 -3
  120. data/plugins/provisioners/ansible/cap/guest/redhat/ansible_install.rb +7 -3
  121. data/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb +1 -1
  122. data/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb +3 -3
  123. data/plugins/provisioners/ansible/config/guest.rb +7 -1
  124. data/plugins/provisioners/ansible/provisioner/guest.rb +1 -1
  125. data/plugins/provisioners/chef/cap/freebsd/chef_install.rb +18 -0
  126. data/plugins/provisioners/chef/cap/freebsd/chef_installed.rb +22 -0
  127. data/plugins/provisioners/chef/plugin.rb +10 -0
  128. data/plugins/provisioners/docker/cap/linux/docker_installed.rb +1 -0
  129. data/plugins/provisioners/salt/bootstrap-salt.ps1 +4 -4
  130. data/plugins/provisioners/shell/config.rb +2 -2
  131. data/plugins/provisioners/shell/provisioner.rb +66 -4
  132. data/plugins/pushes/atlas/push.rb +6 -0
  133. data/plugins/pushes/local-exec/config.rb +2 -2
  134. data/plugins/synced_folders/unix_mount_helpers.rb +105 -0
  135. data/templates/commands/init/Vagrantfile.erb +6 -0
  136. data/templates/commands/init/Vagrantfile.min.erb +3 -0
  137. data/templates/guests/debian/network_dhcp.erb +2 -2
  138. data/templates/guests/gentoo/network_systemd.erb +16 -0
  139. data/templates/guests/redhat/network_dhcp.erb +1 -0
  140. data/templates/guests/redhat/network_static.erb +1 -1
  141. data/templates/guests/redhat/network_static6.erb +1 -1
  142. data/templates/locales/en.yml +72 -3
  143. data/templates/locales/providers_docker.yml +15 -0
  144. data/test/acceptance/provider-virtualbox/linked_clone_spec.rb +1 -1
  145. data/test/unit/plugins/commands/init/command_test.rb +7 -0
  146. data/test/unit/plugins/commands/up/command_test.rb +65 -0
  147. data/test/unit/plugins/commands/validate/command_test.rb +52 -0
  148. data/test/unit/plugins/communicators/ssh/communicator_test.rb +58 -2
  149. data/test/unit/plugins/communicators/winrm/communicator_test.rb +14 -26
  150. data/test/unit/plugins/communicators/winrm/helper_test.rb +12 -0
  151. data/test/unit/plugins/communicators/winrm/shell_test.rb +54 -15
  152. data/test/unit/plugins/communicators/winssh/communicator_test.rb +525 -0
  153. data/test/unit/plugins/guests/arch/cap/configure_networks_test.rb +5 -0
  154. data/test/unit/plugins/guests/esxi/cap/public_key_test.rb +48 -0
  155. data/test/unit/plugins/guests/linux/cap/mount_nfs_test.rb +1 -1
  156. data/test/unit/plugins/guests/linux/cap/mount_smb_shared_folder.rb +71 -0
  157. data/test/unit/plugins/guests/linux/cap/mount_virtual_box_shared_folder_test.rb +43 -0
  158. data/test/unit/plugins/guests/linux/cap/network_interfaces_test.rb +10 -10
  159. data/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb +132 -12
  160. data/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb +23 -0
  161. data/test/unit/plugins/providers/docker/driver_compose_test.rb +268 -0
  162. data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +9 -0
  163. data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +2 -2
  164. data/test/unit/plugins/pushes/atlas/push_test.rb +151 -150
  165. data/test/unit/templates/guests/debian/network_dhcp_test.rb +1 -0
  166. data/test/unit/templates/guests/gentoo/systemd_network_test.rb +73 -0
  167. data/test/unit/templates/guests/redhat/network_dhcp_test.rb +18 -0
  168. data/test/unit/vagrant/action/builtin/box_add_test.rb +27 -0
  169. data/test/unit/vagrant/action/builtin/handle_forwarded_port_collisions_test.rb +170 -0
  170. data/test/unit/vagrant/action/builtin/provision_test.rb +208 -0
  171. data/test/unit/vagrant/box_collection_test.rb +98 -0
  172. data/test/unit/vagrant/environment_test.rb +17 -0
  173. data/test/unit/vagrant/shared_helpers_test.rb +12 -0
  174. data/test/unit/vagrant/util/command_deprecation_test.rb +106 -0
  175. data/test/unit/vagrant/util/env_test.rb +43 -0
  176. data/test/unit/vagrant/util/platform_test.rb +8 -0
  177. data/test/unit/vagrant/util/subprocess_test.rb +61 -0
  178. data/test/vagrant-spec/Vagrantfile.spec +78 -0
  179. data/test/vagrant-spec/boxes/.keep +0 -0
  180. data/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb +10 -0
  181. data/test/vagrant-spec/scripts/centos-run.virtualbox.sh +8 -0
  182. data/test/vagrant-spec/scripts/centos-setup.virtualbox.sh +14 -0
  183. data/test/vagrant-spec/scripts/ubuntu-run.virtualbox.sh +8 -0
  184. data/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh +12 -0
  185. data/vagrant.gemspec +6 -11
  186. data/version.txt +1 -1
  187. metadata +1694 -1835
  188. data/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb +0 -101
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde757e34dcee067f88dff20c6d8817f8b95e772
4
- data.tar.gz: 3e39ba6054e66a9cef60b6219f6f994c10fbea4f
3
+ metadata.gz: d495a5847304cac74b0de42f8db4da2809f58756
4
+ data.tar.gz: e894be37b991f66febb0682cc764d29aefd7aa8d
5
5
  SHA512:
6
- metadata.gz: 65afc154db7e1d92371b4e5e0efebb2bd0e502b8cee4f1f00c0d7e5dd289919343d2089b77d260399c3bcfeb04e5c6e05fc26114cf4a4400ab9d9d502ddde51b
7
- data.tar.gz: a6d2b95aaca2e3669410baa1b8ebed4fdfc3d89830f4ca9551adce07585626eb41f2c3fa2a2c5434d1b7263fd2eb03bbee98dcf4bf74f2262afc4a8f99afe991
6
+ metadata.gz: bc241e8671128f790e56f1f5d6a47ca3e904798e022760702f6327345bbd1e16ed7ae078c69ab07235224ac3d451dc3318e56e3c11fd09224274f0a8baff8e5f
7
+ data.tar.gz: 3d9237118fca1791258ca9adac7fa220306c301d307bbf690c15cee71b946691e7dc83d1ed426940cb54b79df496f0f4388703129b57c2e236b8e6ca65f35225
data/.gitignore CHANGED
@@ -45,3 +45,6 @@ doc/
45
45
  .ruby-gemset
46
46
  .ruby-version
47
47
  .rvmrc
48
+
49
+ # Box storage for spec
50
+ test/vagrant-spec/boxes/*.box
data/CHANGELOG.md CHANGED
@@ -1,3 +1,129 @@
1
+ ## 1.9.5 (May 15, 2017)
2
+
3
+ FEATURES:
4
+
5
+ - hosts/windows: Support running within WSL [GH-8570, GH-8582]
6
+
7
+ IMPROVEMENTS:
8
+
9
+ - communicators/ssh: Retry on aborted connections [GH-8526, GH-8520]
10
+ - communicators/winssh: Enabling shared folders and networking setup [GH-8567]
11
+ - core: Remove nokogiri dependency and constraint [GH-8571]
12
+ - guests: Do not modify existing /etc/hosts content [GH-8506, GH-7794]
13
+ - guests/redhat: Update network configuration capability to properly handle NM [GH-8531]
14
+ - hosts/windows: Check for elevated shell for Hyper-V [GH-8548, GH-8510]
15
+ - hosts/windows: Fix invalid share names on Windows guests from Windows hosts [GH-8433]
16
+ - providers: Return errors from docker/hyperv on ssh when not available [GH-8565, GH-8508]
17
+ - providers/docker: Add support for driving provider with docker-compose [GH-8576]
18
+
19
+ BUG FIXES:
20
+
21
+ - guests/debian: Fix use_dhcp_assigned_default_route [GH-8577, GH-8575]
22
+ - provisioners/shell: Fix Windows batch file provisioning [GH-8539, GH-8535]
23
+ - providers/docker: Fall back to old style for SSH info lookup [GH-8566, GH-8552]
24
+ - providers/hyperv: Fix import script [GH-8529]
25
+ - providers/hyperv: Use string comparison for conditional checks in import scripts [GH-8568, GH-8444]
26
+
27
+ ## 1.9.4 (April 24, 2017)
28
+
29
+ FEATURES:
30
+
31
+ - command/validate: Add Vagrantfile validation command [GH-8264, GH-8151]
32
+ - communicators/winssh: Add WinSSH communicator for Win32-OpenSSH [GH-8485]
33
+ - provider/hyperv: Support integration services configuration [GH-8379, GH-8378]
34
+
35
+ IMPROVEMENTS:
36
+
37
+ - core: Update internal dependencies [GH-8329, GH-8456]
38
+ - core/bundler: Warn when plugin require fails instead of generating hard failure [GH-8400, GH-8392]
39
+ - core/bundler: Error when configured plugin sources are unavailable [GH-8442]
40
+ - guests/elementary: Add support for new guest "Elementary OS" [GH-8472]
41
+ - guests/esxi: Add public_key capability [GH-8310]
42
+ - guests/freebsd: Add chef_install and chef_installed? capabilities [GH-8443]
43
+ - guests/gentoo: Add support for systemd in network configuration [GH-8407, GH-8406]
44
+ - guests/windows: Support mounting synced folders via SSH on windows [GH-7425, GH-6220]
45
+ - hosts/windows: Improve user permission detection [GH-7797]
46
+ - provider/docker: Improve IP and port detection [GH-7840, GH-7651]
47
+ - provider/docker: Do not force docker host VM on Darwin or Windows [GH-8437, GH-7895]
48
+ - provisioners/ansible_local: Add `pip_args` option to define additional parameters when installing Ansible via pip [GH-8170, GH-8405]
49
+ - provisioners/ansible_local: Add `:pip_args_only` install mode to allow full custom pip installations [GH-8405]
50
+ - provisioners/salt: Update minion version installed to 2016.11.3 [GH-8448]
51
+
52
+ BUG FIXES:
53
+
54
+ - command/box: Remove extraneous sort from box list prior to display [GH-8422]
55
+ - command/box: Properly handle local paths with spaces for box add [GH-8503, GH-6825]
56
+ - command/up: Prevent other provider installation when explicitly defined [GH-8393, GH-8389]
57
+ - communicators/ssh: Do not yield empty output data [GH-8495, GH-8259]
58
+ - core: Provide fallback and retry when 0.0.0.0 is unavailable during port check [GH-8399, GH-8395]
59
+ - core: Support port checker methods that do not expect inclusion of host_ip [GH-8497, GH-8423]
60
+ - core/bundler: Check if source is local path and prevent addition to remote sources [GH-8401]
61
+ - core/ui: Prevent deadlock detection errors [GH-8414, GH-8125]
62
+ - guests/debian: Remove hardcoded device name in interface template [GH-8336, GH-7960]
63
+ - guests/linux: Fix SMB mount capbability [GH-8410, GH-8404]
64
+ - hosts/windows: Fix issues with Windows encoding [GH-8385, GH-8380, GH-8212, GH-8207, GH-7516]
65
+ - hosts/windows: Fix UNC path generation when UNC path is provided [GH-8504]
66
+ - provisioners/salt: Allow Salt version to match 2 digit month [GH-8428]
67
+ - provisioners/shell: Properly handle remote paths on Windows that include spaces [GH-8498, GH-7234]
68
+
69
+ ## 1.9.3 (March 21, 2017)
70
+
71
+ IMPROVEMENTS:
72
+
73
+ - command/plugin: Remove requirement for paths with no spaces [GH-7967]
74
+ - core: Support host_ip for forwarded ports [GH-7035, GH-8350]
75
+ - core: Include disk space hint in box install failure message [GH-8089]
76
+ - core/bundler: Allow vagrant constraint matching in prerelease mode [GH-8341]
77
+ - provisioner/docker: Include /bin/docker as valid path [GH-8390]
78
+ - provider/hyperv: Support enabling Hyper-V nested virtualization [GH-8325, GH-7738]
79
+
80
+ BUG FIXES:
81
+
82
+ - communicator/winrm: Prevent inaccurate WinRM address [GH-7983, GH-8073]
83
+ - contrib/bash: Handle path spaces in bash completion [GH-8337]
84
+ - core: Fix box sorting on find and list [GH-7956, GH-8334]
85
+ - core/bundler: Force path as preferred source on install [GH-8327]
86
+ - core/provision: Update "never" behavior to match documentation [GH-8366, GH-8016]
87
+ - plugins/push: Isolate deprecation to Atlas strategy only
88
+ - plugins/synced_folders: Give UID/GID precedence if found within mount options
89
+ [GH-8122, GH-8064, GH-7859]
90
+
91
+ ## 1.9.2 (February 27, 2017)
92
+
93
+ FEATURES:
94
+
95
+ - providers/hyperv: Support packaging of Hyper-V boxes [GH-7867]
96
+ - util/command_deprecation: Add utility module for command deprecation [GH-8300]
97
+ - util/subprocess: Add #stop and #running? methods [GH-8270]
98
+
99
+ IMPROVEMENTS:
100
+
101
+ - commands/expunge: Display default value on prompt and validate input [GH-8192, GH-8171]
102
+ - communicator/winrm: Refactor WinRM communicator to use latest WinRM
103
+ gems and V2 API [GH-8102]
104
+ - core: Scrub URL credentials from output when adding boxes [GH-8194, GH-8117]
105
+ - providers/hyperv: Prefer VMCX over XML configuration when VMCX is supported [GH-8119]
106
+
107
+ BUG FIXES:
108
+
109
+ - command/init: Include box version when using minimal option [GH-8283, GH-8282]
110
+ - command/package: Fix SecureRandom constant error [GH-8159]
111
+ - communicator/ssh: Remove any STDERR output prior to command execution [GH-8291, GH-8288]
112
+ - core/bundler: Prevent pristine warning messages [GH-8191, GH-8190, GH-8147]
113
+ - core/bundler: Fix local installations of pre-release plugins [GH-8252, GH-8253]
114
+ - core/bundler: Prefer user defined source when installing plugins [GH-8273, GH-8210]
115
+ - core/environment: Prevent persisting original environment variable if name is empty
116
+ [GH-8198, GH-8126]
117
+ - core/environment: Fix gems_path location [GH-8248]
118
+ - core/environment: Properly expand dotfile path [GH-8196, GH-8108]
119
+ - guests/arch: Fix configuring multiple network interfaces [GH-8165]
120
+ - guests/linux: Fix guest detection for names with spaces [GH-8092]
121
+ - guests/redhat: Fix network interface configuration [GH-8148]
122
+
123
+ DEPRECATIONS:
124
+
125
+ - command/push: Disable push command [GH-8300]
126
+
1
127
  ## 1.9.1 (December 7, 2016)
2
128
 
3
129
  IMPROVEMENTS:
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2010-2016 Mitchell Hashimoto
3
+ Copyright (c) 2010-2017 Mitchell Hashimoto
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -21,7 +21,7 @@ between Windows, Mac OS X, and Linux.
21
21
  For the quick-start, we'll bring up a development machine on
22
22
  [VirtualBox](https://www.virtualbox.org/) because it is free and works
23
23
  on all major platforms. Vagrant can, however, work with almost any
24
- system such as [OpenStack] (https://www.openstack.org/), [VMware] (https://www.vmware.com/), [Docker] (https://docs.docker.com/), etc.
24
+ system such as [OpenStack](https://www.openstack.org/), [VMware](https://www.vmware.com/), [Docker](https://docs.docker.com/), etc.
25
25
 
26
26
  First, make sure your development machine has
27
27
  [VirtualBox](https://www.virtualbox.org/)
data/bin/vagrant CHANGED
@@ -117,6 +117,17 @@ begin
117
117
  logger.debug("Creating Vagrant environment")
118
118
  env = Vagrant::Environment.new(opts)
119
119
 
120
+ # If we are running with the Windows Subsystem for Linux do
121
+ # some extra setup to allow access to Vagrant managed machines
122
+ # outside the subsystem
123
+ if Vagrant::Util::Platform.wsl?
124
+ recreate_env = Vagrant::Util::Platform.wsl_init(env, logger)
125
+ if recreate_env
126
+ logger.info("Re-creating Vagrant environment due to WSL modifications.")
127
+ env = Vagrant::Environment.new(opts)
128
+ end
129
+ end
130
+
120
131
  if !Vagrant.in_installer? && !Vagrant.very_quiet?
121
132
  # If we're not in the installer, warn.
122
133
  #env.ui.warn(I18n.t("vagrant.general.not_in_installer") + "\n", prefix: false)
@@ -71,9 +71,9 @@ _vagrant() {
71
71
  ;;
72
72
  "up")
73
73
  vagrant_state_file=$(__vagrantinvestigate) || return 1
74
- if [[ -d $vagrant_state_file ]]
74
+ if [[ -d "${vagrant_state_file}" ]]
75
75
  then
76
- local vm_list=$(find $vagrant_state_file/machines -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
76
+ local vm_list=$(find "${vagrant_state_file}/machines" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
77
77
  fi
78
78
  local up_commands="--no-provision"
79
79
  COMPREPLY=($(compgen -W "${up_commands} ${vm_list}" -- ${cur}))
@@ -81,12 +81,12 @@ _vagrant() {
81
81
  ;;
82
82
  "ssh"|"provision"|"reload"|"halt"|"suspend"|"resume"|"ssh-config")
83
83
  vagrant_state_file=$(__vagrantinvestigate) || return 1
84
- if [[ -f $vagrant_state_file ]]
84
+ if [[ -f "${vagrant_state_file}" ]]
85
85
  then
86
- running_vm_list=$(grep 'active' $vagrant_state_file | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
87
- else
88
- running_vm_list=$(find $vagrant_state_file -type f -name "id" | awk -F"/" '{print $(NF-2)}')
89
- fi
86
+ running_vm_list=$(grep 'active' "${vagrant_state_file}" | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
87
+ else
88
+ running_vm_list=$(find "${vagrant_state_file}" -type f -name "id" | awk -F"/" '{print $(NF-2)}')
89
+ fi
90
90
  COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur}))
91
91
  return 0
92
92
  ;;
@@ -121,9 +121,9 @@ _vagrant() {
121
121
  "up")
122
122
  if [ "$prev" == "--no-provision" ]
123
123
  then
124
- if [[ -d $vagrant_state_file ]]
124
+ if [[ -d "${vagrant_state_file}" ]]
125
125
  then
126
- local vm_list=$(find $vagrant_state_file/machines -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
126
+ local vm_list=$(find "${vagrant_state_file}/machines" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
127
127
  fi
128
128
  COMPREPLY=($(compgen -W "${vm_list}" -- ${cur}))
129
129
  return 0
data/lib/vagrant.rb CHANGED
@@ -226,7 +226,9 @@ module Vagrant
226
226
  ENV.each do |k,v|
227
227
  if k.start_with?("VAGRANT_OLD_ENV")
228
228
  key = k.sub(/^VAGRANT_OLD_ENV_/, "")
229
- h[key] = v
229
+ if !key.empty?
230
+ h[key] = v
231
+ end
230
232
  end
231
233
  end
232
234
  end
@@ -318,7 +320,7 @@ if Vagrant.plugins_enabled?
318
320
  global_logger.debug("Loading plugin `#{plugin_name}` with slash require: `#{plugin_slash}`")
319
321
  require plugin_slash
320
322
  rescue LoadError, Gem::LoadError
321
- raise load_error
323
+ global_logger.warn("Failed to load plugin `#{plugin_name}`. Assuming library and moving on.")
322
324
  end
323
325
  end
324
326
  end
@@ -168,12 +168,15 @@ module Vagrant
168
168
  url = url[0]
169
169
  end
170
170
 
171
+ display_original_url = Util::CredentialScrubber.scrub(Array(original_url).first)
172
+ display_url = Util::CredentialScrubber.scrub(url)
173
+
171
174
  env[:ui].output(I18n.t(
172
175
  "vagrant.box_loading_metadata",
173
- name: Array(original_url).first))
176
+ name: display_original_url))
174
177
  if original_url != url
175
178
  env[:ui].detail(I18n.t(
176
- "vagrant.box_expanding_url", url: url))
179
+ "vagrant.box_expanding_url", url: display_url))
177
180
  end
178
181
 
179
182
  metadata = nil
@@ -189,8 +192,8 @@ module Vagrant
189
192
  raise if !expanded
190
193
  raise Errors::BoxAddShortNotFound,
191
194
  error: e.extra_data[:message],
192
- name: original_url,
193
- url: url
195
+ name: display_original_url,
196
+ url: display_url
194
197
  ensure
195
198
  metadata_path.delete if metadata_path && metadata_path.file?
196
199
  end
@@ -208,12 +211,12 @@ module Vagrant
208
211
  raise Errors::BoxAddNoMatchingProvider,
209
212
  name: metadata.name,
210
213
  requested: provider,
211
- url: url
214
+ url: display_url
212
215
  else
213
216
  raise Errors::BoxAddNoMatchingVersion,
214
217
  constraints: version || ">= 0",
215
218
  name: metadata.name,
216
- url: url,
219
+ url: display_url,
217
220
  versions: metadata.versions.join(", ")
218
221
  end
219
222
  end
@@ -265,7 +268,7 @@ module Vagrant
265
268
  raise "Bad box authentication hook, did not generate proper results."
266
269
  end
267
270
  provider_url = authed_urls[0]
268
- end
271
+ end
269
272
 
270
273
  box_add(
271
274
  [[provider_url, metadata_provider.url]],
@@ -429,6 +432,7 @@ module Vagrant
429
432
  if opts[:ui]
430
433
  show_url = opts[:show_url]
431
434
  show_url ||= url
435
+ display_url = Util::CredentialScrubber.scrub(show_url)
432
436
 
433
437
  translation = "vagrant.box_downloading"
434
438
 
@@ -439,7 +443,7 @@ module Vagrant
439
443
 
440
444
  env[:ui].detail(I18n.t(
441
445
  translation,
442
- url: show_url))
446
+ url: display_url))
443
447
  if File.file?(d.destination)
444
448
  env[:ui].info(I18n.t("vagrant.actions.box.download.resuming"))
445
449
  end
@@ -474,6 +478,7 @@ module Vagrant
474
478
  url ||= uri.opaque
475
479
  #7570 Strip leading slash left in front of drive letter by uri.path
476
480
  Util::Platform.windows? && url.gsub!(/^\/([a-zA-Z]:)/, '\1')
481
+ url = URI.unescape(url)
477
482
 
478
483
  begin
479
484
  File.open(url, "r") do |f|
@@ -62,7 +62,13 @@ module Vagrant
62
62
  @logger.info("Detecting any forwarded port collisions...")
63
63
 
64
64
  # Get the extra ports we consider in use
65
- extra_in_use = env[:port_collision_extra_in_use] || []
65
+ extra_in_use = env[:port_collision_extra_in_use] || {}
66
+
67
+ # If extras are provided as an Array (previous behavior) convert
68
+ # to Hash as expected for IP aliasing support
69
+ if extra_in_use.is_a?(Array)
70
+ extra_in_use = Hash[extra_in_use.map{|port| [port, Set.new(["*"])]}]
71
+ end
66
72
 
67
73
  # Get the remap
68
74
  remap = env[:port_collision_remap] || {}
@@ -81,7 +87,7 @@ module Vagrant
81
87
 
82
88
  # Determine a list of usable ports for repair
83
89
  usable_ports = Set.new(env[:machine].config.vm.usable_port_range)
84
- usable_ports.subtract(extra_in_use)
90
+ usable_ports.subtract(extra_in_use.keys)
85
91
 
86
92
  # Pass one, remove all defined host ports from usable ports
87
93
  with_forwarded_ports(env) do |options|
@@ -92,6 +98,7 @@ module Vagrant
92
98
  with_forwarded_ports(env) do |options|
93
99
  guest_port = options[:guest]
94
100
  host_port = options[:host]
101
+ host_ip = options[:host_ip]
95
102
 
96
103
  if options[:disabled]
97
104
  @logger.debug("Skipping disabled port #{host_port}.")
@@ -110,9 +117,9 @@ module Vagrant
110
117
  end
111
118
 
112
119
  # If the port is open (listening for TCP connections)
113
- in_use = extra_in_use.include?(host_port) ||
114
- port_checker[host_port] ||
115
- lease_check(host_port)
120
+ in_use = is_forwarded_already(extra_in_use, host_port, host_ip) ||
121
+ call_port_checker(port_checker, host_ip, host_port) ||
122
+ lease_check(host_ip, host_port)
116
123
  if in_use
117
124
  if !repair || !options[:auto_correct]
118
125
  raise Errors::ForwardPortCollision,
@@ -129,9 +136,9 @@ module Vagrant
129
136
  usable_ports.delete(repaired_port)
130
137
 
131
138
  # If the port is in use, then we can't use this either...
132
- in_use = extra_in_use.include?(repaired_port) ||
133
- port_checker[repaired_port] ||
134
- lease_check(repaired_port)
139
+ in_use = is_forwarded_already(extra_in_use, repaired_port, host_ip) ||
140
+ call_port_checker(port_checker, host_ip, repaired_port) ||
141
+ lease_check(host_ip, repaired_port)
135
142
  if in_use
136
143
  @logger.info("Repaired port also in use: #{repaired_port}. Trying another...")
137
144
  next
@@ -163,13 +170,19 @@ module Vagrant
163
170
  end
164
171
  end
165
172
 
166
- def lease_check(port)
173
+ def lease_check(host_ip=nil, host_port)
167
174
  # Check if this port is "leased". We use a leasing system of
168
175
  # about 60 seconds to avoid any forwarded port collisions in
169
176
  # a highly parallelized environment.
170
177
  leasedir = @machine.env.data_dir.join("fp-leases")
171
178
  leasedir.mkpath
172
179
 
180
+ if host_ip.nil?
181
+ lease_file_name = host_port.to_s
182
+ else
183
+ lease_file_name = "#{host_ip.gsub('.','_')}_#{host_port.to_s}"
184
+ end
185
+
173
186
  invalid = false
174
187
  oldest = Time.now.to_i - 60
175
188
  leasedir.children.each do |child|
@@ -178,7 +191,7 @@ module Vagrant
178
191
  child.delete
179
192
  end
180
193
 
181
- if child.basename.to_s == port.to_s
194
+ if child.basename.to_s == lease_file_name
182
195
  invalid = true
183
196
  end
184
197
  end
@@ -187,13 +200,13 @@ module Vagrant
187
200
  return true if invalid
188
201
 
189
202
  # Otherwise, create the lease
190
- leasedir.join(port.to_s).open("w+") do |f|
203
+ leasedir.join(lease_file_name).open("w+") do |f|
191
204
  f.binmode
192
205
  f.write(Time.now.to_i.to_s + "\n")
193
206
  end
194
207
 
195
208
  # Add to the leased array so we unlease it right away
196
- @leased << port.to_s
209
+ @leased << lease_file_name
197
210
 
198
211
  # Things look good to us!
199
212
  false
@@ -208,8 +221,41 @@ module Vagrant
208
221
  end
209
222
  end
210
223
 
211
- def port_check(port)
212
- is_port_open?("127.0.0.1", port)
224
+ # This functions checks to see if the current instance's hostport and
225
+ # hostip for forwarding is in use by the virtual machines created
226
+ # previously.
227
+ def is_forwarded_already(extra_in_use, hostport, hostip)
228
+ hostip = '*' if hostip.nil? || hostip.empty?
229
+ # ret. false if none of the VMs we spun up had this port forwarded.
230
+ return false if not extra_in_use.has_key?(hostport)
231
+
232
+ # ret. true if the user has requested to bind on all interfaces but
233
+ # we already have a rule in one the VMs we spun up.
234
+ if hostip == '*'
235
+ if extra_in_use.fetch(hostport).size != 0
236
+ return true
237
+ else
238
+ return false
239
+ end
240
+ end
241
+
242
+ return extra_in_use.fetch(hostport).include?(hostip)
243
+ end
244
+
245
+ def port_check(host_ip, host_port)
246
+ # If no host_ip is specified, intention taken to be list on all interfaces.
247
+ # If platform is windows, default back to localhost only
248
+ test_host_ip = host_ip || "0.0.0.0"
249
+ begin
250
+ is_port_open?(test_host_ip, host_port)
251
+ rescue Errno::EADDRNOTAVAIL
252
+ if !host_ip && test_host_ip == "0.0.0.0"
253
+ test_host_ip = "127.0.0.1"
254
+ retry
255
+ else
256
+ raise
257
+ end
258
+ end
213
259
  end
214
260
 
215
261
  def with_forwarded_ports(env)
@@ -220,6 +266,13 @@ module Vagrant
220
266
  yield options
221
267
  end
222
268
  end
269
+
270
+ def call_port_checker(port_checker, host_ip, host_port)
271
+ call_args = [host_ip, host_port]
272
+ # Trim args if checker method does not support inclusion of host_ip
273
+ call_args = call_args.slice(call_args.size - port_checker.arity.abs, port_checker.arity.abs)
274
+ port_checker[*call_args]
275
+ end
223
276
  end
224
277
  end
225
278
  end