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
@@ -63,10 +63,10 @@ module VagrantPlugins
63
63
  def args_valid?
64
64
  return true if !args
65
65
  return true if args.is_a?(String)
66
- return true if args.is_a?(Fixnum)
66
+ return true if args.is_a?(Integer)
67
67
  if args.is_a?(Array)
68
68
  args.each do |a|
69
- return false if !a.kind_of?(String) && !a.kind_of?(Fixnum)
69
+ return false if !a.kind_of?(String) && !a.kind_of?(Integer)
70
70
  end
71
71
 
72
72
  return true
@@ -0,0 +1,105 @@
1
+ require "shellwords"
2
+ require "vagrant/util/retryable"
3
+
4
+ module VagrantPlugins
5
+ module SyncedFolder
6
+ module UnixMountHelpers
7
+
8
+ def self.extended(klass)
9
+ if !klass.class_variable_defined?(:@@logger)
10
+ klass.class_variable_set(:@@logger, Log4r::Logger.new(klass.name.downcase))
11
+ end
12
+ klass.extend Vagrant::Util::Retryable
13
+ end
14
+
15
+ def detect_owner_group_ids(machine, guest_path, mount_options, options)
16
+ mount_uid = find_mount_options_id("uid", mount_options)
17
+ mount_gid = find_mount_options_id("gid", mount_options)
18
+
19
+ if mount_uid.nil?
20
+ if options[:owner].to_i.to_s == options[:owner].to_s
21
+ mount_uid = options[:owner]
22
+ self.class_variable_get(:@@logger).debug("Owner user ID (provided): #{mount_uid}")
23
+ else
24
+ output = {stdout: '', stderr: ''}
25
+ uid_command = "id -u #{options[:owner]}"
26
+ machine.communicate.execute(uid_command,
27
+ error_class: Vagrant::Errors::VirtualBoxMountFailed,
28
+ error_key: :virtualbox_mount_failed,
29
+ command: uid_command,
30
+ output: output[:stderr]
31
+ ) { |type, data| output[type] << data if output[type] }
32
+ mount_uid = output[:stdout].chomp
33
+ self.class_variable_get(:@@logger).debug("Owner user ID (lookup): #{options[:owner]} -> #{mount_uid}")
34
+ end
35
+ else
36
+ machine.ui.warn "Detected mount owner ID within mount options. (uid: #{mount_uid} guestpath: #{guest_path})"
37
+ end
38
+
39
+ if mount_gid.nil?
40
+ if options[:group].to_i.to_s == options[:group].to_s
41
+ mount_gid = options[:group]
42
+ self.class_variable_get(:@@logger).debug("Owner group ID (provided): #{mount_gid}")
43
+ else
44
+ begin
45
+ output = {stdout: '', stderr: ''}
46
+ gid_command = "getent group #{options[:group]}"
47
+ machine.communicate.execute(gid_command,
48
+ error_class: Vagrant::Errors::VirtualBoxMountFailed,
49
+ error_key: :virtualbox_mount_failed,
50
+ command: gid_command,
51
+ output: output[:stderr]
52
+ ) { |type, data| output[type] << data if output[type] }
53
+ mount_gid = output[:stdout].split(':').at(2)
54
+ self.class_variable_get(:@@logger).debug("Owner group ID (lookup): #{options[:group]} -> #{mount_gid}")
55
+ rescue Vagrant::Errors::VirtualBoxMountFailed
56
+ if options[:owner] == options[:group]
57
+ self.class_variable_get(:@@logger).debug("Failed to locate group `#{options[:group]}`. Group name matches owner. Fetching effective group ID.")
58
+ output = {stdout: ''}
59
+ result = machine.communicate.execute("id -g #{options[:owner]}",
60
+ error_check: false
61
+ ) { |type, data| output[type] << data if output[type] }
62
+ mount_gid = output[:stdout].chomp if result == 0
63
+ self.class_variable_get(:@@logger).debug("Owner group ID (effective): #{mount_gid}")
64
+ end
65
+ raise unless mount_gid
66
+ end
67
+ end
68
+ else
69
+ machine.ui.warn "Detected mount group ID within mount options. (gid: #{mount_gid} guestpath: #{guest_path})"
70
+ end
71
+ {:gid => mount_gid, :uid => mount_uid}
72
+ end
73
+
74
+ def find_mount_options_id(id_name, mount_options)
75
+ id_line = mount_options.detect{|line| line.include?("#{id_name}=")}
76
+ if id_line
77
+ match = id_line.match(/,?#{Regexp.escape(id_name)}=(?<option_id>\d+),?/)
78
+ found_id = match["option_id"]
79
+ updated_id_line = [
80
+ match.pre_match,
81
+ match.post_match
82
+ ].find_all{|string| !string.empty?}.join(',')
83
+ if updated_id_line.empty?
84
+ mount_options.delete(id_line)
85
+ else
86
+ idx = mount_options.index(id_line)
87
+ mount_options.delete(idx)
88
+ mount_options.insert(idx, updated_id_line)
89
+ end
90
+ end
91
+ found_id
92
+ end
93
+
94
+ def emit_upstart_notification(machine, guest_path)
95
+ # Emit an upstart event if we can
96
+ machine.communicate.sudo <<-EOH.gsub(/^ {12}/, "")
97
+ if command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
98
+ /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path}
99
+ fi
100
+ EOH
101
+ end
102
+
103
+ end
104
+ end
105
+ end
@@ -31,8 +31,14 @@ Vagrant.configure("2") do |config|
31
31
  # Create a forwarded port mapping which allows access to a specific port
32
32
  # within the machine from a port on the host machine. In the example below,
33
33
  # accessing "localhost:8080" will access port 80 on the guest machine.
34
+ # NOTE: This will enable public access to the opened port
34
35
  # config.vm.network "forwarded_port", guest: 80, host: 8080
35
36
 
37
+ # Create a forwarded port mapping which allows access to a specific port
38
+ # within the machine from a port on the host machine and only allow access
39
+ # via 127.0.0.1 to disable public access
40
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
41
+
36
42
  # Create a private network, which allows host-only access to the machine
37
43
  # using a specific IP.
38
44
  # config.vm.network "private_network", ip: "192.168.33.10"
@@ -1,5 +1,8 @@
1
1
  Vagrant.configure("2") do |config|
2
2
  config.vm.box = "<%= box_name %>"
3
+ <% if box_version -%>
4
+ config.vm.box_version = "<%= box_version %>"
5
+ <% end -%>
3
6
  <% if box_url -%>
4
7
  config.vm.box_url = "<%= box_url %>"
5
8
  <% end -%>
@@ -6,8 +6,8 @@ iface <%= options[:device] %> inet dhcp
6
6
  post-up route del default dev $IFACE || true
7
7
  <% else %>
8
8
  # We need to disable eth0, see GH-2648
9
- post-up route del default dev eth0 || true
9
+ post-up route del default dev <%= options[:root_device] %> || true
10
10
  post-up dhclient $IFACE
11
- pre-down route add default dev eth0
11
+ pre-down route add default dev <%= options[:root_device] %>
12
12
  <% end %>
13
13
  #VAGRANT-END
@@ -0,0 +1,16 @@
1
+ [Match]
2
+ Name=<%= networks[0][:device] %>
3
+
4
+ [Network]
5
+ <%- gateway = nil %>
6
+ <%- networks.each do |net| %>
7
+ <%- if net[:type] == 'dhcp' %>
8
+ DHCP=yes
9
+ <%- elsif net[:ip] %>
10
+ Address=<%= net[:ip] %>/<%= net[:netmask] %>
11
+ <%- end %>
12
+ <%- gateway ||= net[:gateway] %>
13
+ <%- end %>
14
+ <%- if gateway %>
15
+ Gateway=<%= gateway %>
16
+ <%- end %>
@@ -3,4 +3,5 @@
3
3
  BOOTPROTO=dhcp
4
4
  ONBOOT=yes
5
5
  DEVICE=<%= options[:device] %>
6
+ NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
6
7
  #VAGRANT-END
@@ -1,6 +1,6 @@
1
1
  #VAGRANT-BEGIN
2
2
  # The contents below are automatically generated by Vagrant. Do not modify.
3
- NM_CONTROLLED=no
3
+ NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
4
4
  BOOTPROTO=none
5
5
  ONBOOT=yes
6
6
  IPADDR=<%= options[:ip] %>
@@ -1,6 +1,6 @@
1
1
  #VAGRANT-BEGIN
2
2
  # The contents below are automatically generated by Vagrant. Do not modify.
3
- NM_CONTROLLED=no
3
+ NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
4
4
  BOOTPROTO=static
5
5
  ONBOOT=yes
6
6
  DEVICE=<%= options[:device] %>
@@ -664,6 +664,9 @@ en:
664
664
  Additionally, the created environment must be started with a provider
665
665
  matching this provider. For example, if you're using VirtualBox,
666
666
  the clone environment must also be using VirtualBox.
667
+ command_deprecated: |-
668
+ The command 'vagrant %{name}' has been deprecated and is no longer functional
669
+ within Vagrant.
667
670
  command_unavailable: |-
668
671
  The executable '%{file}' Vagrant is trying to run was not
669
672
  found in the PATH variable. This is an error. Please verify
@@ -879,6 +882,13 @@ en:
879
882
  %{message}
880
883
  network_type_not_supported: |-
881
884
  The %{type} network type is not supported for this box or guest.
885
+ network_manager_not_installed: |-
886
+ Vagrant was instructed to configure the %{device} network device to
887
+ be managed by NetworkManager. However, the configured guest VM does
888
+ not have NetworkManager installed. To fix this error please remove
889
+ the `nm_controlled` setting from local Vagantfile. If NetworkManager
890
+ is required to manage the network devices, please use a box with
891
+ NetworkManager installed.
882
892
  nfs_bad_exports: |-
883
893
  NFS is reporting that your exports file is invalid. Vagrant does
884
894
  this check before making any changes to the file. Please correct
@@ -1017,6 +1027,16 @@ en:
1017
1027
  You can however, install a plugin with the same name to replace
1018
1028
  these plugins. User-installed plugins take priority over
1019
1029
  system-installed plugins.
1030
+ plugin_source_error: |-
1031
+ Vagrant failed to load a configured plugin source. This can be caused
1032
+ by a variety of issues including: transient connectivity issues, proxy
1033
+ filtering rejecting access to a configured plugin source, or a configured
1034
+ plugin source not responding correctly. Please review the error message
1035
+ below to help resolve the issue:
1036
+
1037
+ %{error_msg}
1038
+
1039
+ Source: %{source}
1020
1040
  pushes_not_defined: |-
1021
1041
  The Vagrantfile does not define any 'push' strategies. In order to use
1022
1042
  `vagrant push`, you must define at least one push strategy:
@@ -1176,6 +1196,13 @@ en:
1176
1196
  If that doesn't work, destroy your VM and recreate it with a `vagrant destroy`
1177
1197
  followed by a `vagrant up`. If that doesn't work, contact a Vagrant
1178
1198
  maintainer (support channels listed on the website) for more assistance.
1199
+ ssh_connection_aborted: |-
1200
+ SSH connection was aborted! This usually happens when the machine is taking
1201
+ too long to reboot or the SSH daemon is not properly configured on the VM.
1202
+ First, try reloading your machine with `vagrant reload`, since a simple
1203
+ restart sometimes fixes things. If that doesn't work, destroy your machine
1204
+ and recreate it with a `vagrant destroy` followed by a `vagrant up`. If that
1205
+ doesn't work, contact support.
1179
1206
  ssh_connection_reset: |-
1180
1207
  SSH connection was reset! This usually happens when the machine is
1181
1208
  taking too long to reboot. First, try reloading your machine with
@@ -1354,6 +1381,16 @@ en:
1354
1381
  log out and log back in for the new environmental variables to take
1355
1382
  effect. If you're on Linux or Mac, verify your PATH contains the folder
1356
1383
  that has VBoxManage in it.
1384
+ vboxmanage_not_found_wsl_error: |-
1385
+ The "VBoxManage.exe" command or one of its dependencies could not
1386
+ be found. Please verify VirtualBox is properly installed. You can verify
1387
+ everything is okay by running "VBoxManage.exe --version" and verifying
1388
+ that the VirtualBox version is outputted.
1389
+
1390
+ If you just installed VirtualBox, you have to log out and log back in for
1391
+ the new environmental variables to take effect. Using the VirtualBox
1392
+ provider within the WSL requires VirtualBox executables to be available
1393
+ on the system PATH.
1357
1394
  virtualbox_broken_version_040214: |-
1358
1395
  Vagrant detected you have VirtualBox 4.2.14 installed. VirtualBox
1359
1396
  4.2.14 contains a critical bug which prevents it from working with
@@ -1483,7 +1520,32 @@ en:
1483
1520
  VM must be running to open SSH connection. Run `vagrant up`
1484
1521
  to start the virtual machine.
1485
1522
  test_key: "test value"
1486
-
1523
+ wsl_vagrant_version_mismatch: |-
1524
+ Vagrant cannot currently enable access to manage machines within the Windows
1525
+ environment because the version of Vagrant installed on Windows does not
1526
+ match this version of Vagrant running within the Windows Subsystem for Linux.
1527
+ Please ensure both installation of Vagrant are the same. If you do not want
1528
+ update your Vagrant installations you can disable Windows access by unsetting
1529
+ the `VAGRANT_WSL_ACCESS_WINDOWS_USER` environment variable.
1530
+
1531
+ Windows Vagrant version: %{windows_version}
1532
+ Windows Subsystem for Linux Vagrant version: %{wsl_version}
1533
+ wsl_vagrant_access_error: |-
1534
+ Vagrant will not operate outside the Windows Subsystem for Linux unless explicitly
1535
+ instructed. Due to the inability to enforce expected Linux file ownership and
1536
+ permissions on the Windows system, Vagrant will not make modifications to prevent
1537
+ unexpected errors. To learn more about this, and the options that are available,
1538
+ please refer to the Vagrant documentation:
1539
+
1540
+ https://www.vagrantup.com/docs/other/wsl
1541
+ wsl_virtualbox_windows_access: |-
1542
+ Vagrant is unable to use the VirtualBox provider from the Windows Subsystem for
1543
+ Linux without access to the Windows environment. Enabling this access must be
1544
+ done with caution and an understanding of the implications. For more information
1545
+ on enabing Windows access and using VirtualBox from the Windows Subsystem for
1546
+ Linux, please refer to the Vagrant documentation:
1547
+
1548
+ https://www.vagrantup.com/docs/other/wsl
1487
1549
  #-------------------------------------------------------------------------------
1488
1550
  # Translations for config validation errors
1489
1551
  #-------------------------------------------------------------------------------
@@ -1568,6 +1630,9 @@ en:
1568
1630
  # Translations for commands. e.g. `vagrant x`
1569
1631
  #-------------------------------------------------------------------------------
1570
1632
  commands:
1633
+ deprecated: |-
1634
+ [DEPRECATION WARNING]: The Vagrant command 'vagrant %{name}' is scheduled be
1635
+ deprecated in an upcoming Vagrant release.
1571
1636
  common:
1572
1637
  vm_already_running: |-
1573
1638
  VirtualBox VM is already running.
@@ -1726,6 +1791,9 @@ en:
1726
1791
  up:
1727
1792
  upping: |-
1728
1793
  Bringing machine '%{name}' up with '%{provider}' provider...
1794
+ validate:
1795
+ success: |-
1796
+ Vagrantfile validated successfully.
1729
1797
 
1730
1798
  #-------------------------------------------------------------------------------
1731
1799
  # Translations for Vagrant middleware actions
@@ -1975,8 +2043,9 @@ en:
1975
2043
  unpackage:
1976
2044
  untar_failure: |-
1977
2045
  The box failed to unpackage properly. Please verify that the box
1978
- file you're trying to add is not corrupted and try again. The
1979
- output from attempting to unpackage (if any):
2046
+ file you're trying to add is not corrupted and that enough disk space
2047
+ is available and then try again.
2048
+ The output from attempting to unpackage (if any):
1980
2049
 
1981
2050
  %{output}
1982
2051
  add:
@@ -117,6 +117,19 @@ en:
117
117
  run exits and doesn't keep running.
118
118
 
119
119
  errors:
120
+ compose_lock_timeout: |-
121
+ Vagrant enountered a timeout waiting for the docker compose driver
122
+ to become available. Please try to run your command again. If you
123
+ continue to experience this error it may be resolved by disabling
124
+ parallel execution.
125
+ docker_compose_not_installed: |-
126
+ Vagrant has been instructed to use to use the Compose driver for the
127
+ Docker plugin but was unable to locate the `docker-compose` executable.
128
+ Ensure that `docker-compose` is installed and available on the PATH.
129
+ not_created: |-
130
+ The container hasn't been created yet.
131
+ not_running: |-
132
+ The container is not currently running.
120
133
  communicator_non_docker: |-
121
134
  The "docker_hostvm" communicator was specified on a machine that
122
135
  is not provided by the Docker provider. This is a bug with your
@@ -130,6 +143,8 @@ en:
130
143
  "build_dir" must exist and contain a Dockerfile
131
144
  build_dir_or_image: |-
132
145
  One of "build_dir" or "image" must be set
146
+ compose_configuration_hash: |-
147
+ "compose_configuration" must be a hash
133
148
  create_args_array: |-
134
149
  "create_args" must be an array
135
150
  invalid_link: |-
@@ -9,7 +9,7 @@ shared_examples 'provider/linked_clone' do |provider, options|
9
9
 
10
10
  before do
11
11
  environment.skeleton('linked_clone')
12
- assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
12
+ assert_execute('vagrant', 'box', 'add', 'box', options[:box])
13
13
  end
14
14
 
15
15
  after do
@@ -78,6 +78,13 @@ describe VagrantPlugins::CommandInit::Command do
78
78
  expect(contents).to match(/config.vm.box_version = "1.2.3"/)
79
79
  end
80
80
 
81
+ it "creates a minimal Vagrantfile with a box and box version" do
82
+ described_class.new(["--minimal", "--box-version", "1.2.3", "hashicorp/precise64"], env).execute
83
+ contents = File.read(vagrantfile_path)
84
+ expect(contents).to match(/config.vm.box = "hashicorp\/precise64"/)
85
+ expect(contents).to match(/config.vm.box_version = "1.2.3"/)
86
+ end
87
+
81
88
  it "creates a Vagrantfile at a custom path" do
82
89
  described_class.new(["--output", "vf.rb"], env).execute
83
90
  expect(File.exist?(File.join(env.cwd, "vf.rb"))).to be(true)
@@ -0,0 +1,65 @@
1
+ require File.expand_path("../../../../base", __FILE__)
2
+
3
+ require Vagrant.source_root.join("plugins/commands/up/command")
4
+
5
+ describe VagrantPlugins::CommandUp::Command do
6
+ include_context "unit"
7
+
8
+ let(:argv) { [] }
9
+ let(:vagrantfile_content){ "" }
10
+ let(:iso_env) do
11
+ env = isolated_environment
12
+ env.vagrantfile(vagrantfile_content)
13
+ env.create_vagrant_env
14
+ end
15
+
16
+ subject { described_class.new(argv, iso_env) }
17
+
18
+ let(:action_runner) { double("action_runner") }
19
+
20
+ before do
21
+ iso_env.stub(action_runner: action_runner)
22
+ end
23
+
24
+ context "with no argument" do
25
+ let(:vagrantfile_content){ "Vagrant.configure(2){|config| config.vm.box = 'dummy'}" }
26
+
27
+ it "should bring up the default box" do
28
+ batch = double("environment_batch")
29
+ expect(iso_env).to receive(:batch).and_yield(batch)
30
+ expect(batch).to receive(:action).with(anything, :up, anything)
31
+ subject.execute
32
+ end
33
+
34
+ context "with VAGRANT_DEFAULT_PROVIDER set" do
35
+ before do
36
+ if ENV["VAGRANT_DEFAULT_PROVIDER"]
37
+ @original_default = ENV["VAGRANT_DEFAULT_PROVIDER"]
38
+ end
39
+ ENV["VAGRANT_DEFAULT_PROVIDER"] = "unknown"
40
+ end
41
+ after do
42
+ if @original_default
43
+ ENV["VAGRANT_DEFAULT_PROVIDER"] = @original_default
44
+ else
45
+ ENV.delete("VAGRANT_DEFAULT_PROVIDER")
46
+ end
47
+ end
48
+
49
+ it "should attempt to use dummy provider" do
50
+ expect{ subject.execute }.to raise_error
51
+ end
52
+
53
+ context "with --provider set" do
54
+ let(:argv){ ["--provider", "dummy"] }
55
+
56
+ it "should only use provider explicitly set" do
57
+ batch = double("environment_batch")
58
+ expect(iso_env).to receive(:batch).and_yield(batch)
59
+ expect(batch).to receive(:action).with(anything, :up, anything)
60
+ subject.execute
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end