vagrant 1.0.7 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.copywrite.hcl +15 -0
- data/.gitignore +57 -21
- data/.vimrc +5 -0
- data/CHANGELOG.md +3795 -6
- data/Gemfile +10 -1
- data/LICENSE +92 -21
- data/README.md +32 -67
- data/RELEASE.md +11 -0
- data/Rakefile +5 -1
- data/Vagrantfile +31 -0
- data/bin/vagrant +239 -29
- data/contrib/README.md +8 -3
- data/contrib/bash/completion.sh +190 -0
- data/contrib/emacs/vagrant.el +3 -0
- data/contrib/st/Ruby.sublime-settings +6 -0
- data/contrib/sudoers/linux-fedora +7 -0
- data/contrib/sudoers/linux-suse +6 -0
- data/contrib/sudoers/linux-ubuntu +8 -0
- data/contrib/sudoers/osx +10 -0
- data/contrib/zsh/_vagrant +738 -0
- data/contrib/zsh/generate_zsh_completion.rb +168 -0
- data/ext/vagrant/vagrant_ssl/extconf.rb +24 -0
- data/ext/vagrant/vagrant_ssl/vagrant_ssl.c +37 -0
- data/ext/vagrant/vagrant_ssl/vagrant_ssl.h +19 -0
- data/keys/README.md +15 -9
- data/keys/vagrant.key.ed25519 +7 -0
- data/keys/vagrant.key.rsa +27 -0
- data/keys/vagrant.pub +1 -0
- data/keys/vagrant.pub.ed25519 +1 -0
- data/keys/vagrant.pub.rsa +1 -0
- data/lib/vagrant/action/builder.rb +263 -35
- data/lib/vagrant/action/builtin/box_add.rb +638 -0
- data/lib/vagrant/action/builtin/box_check_outdated.rb +116 -0
- data/lib/vagrant/action/builtin/box_remove.rb +181 -0
- data/lib/vagrant/action/builtin/box_update.rb +23 -0
- data/lib/vagrant/action/builtin/call.rb +69 -0
- data/lib/vagrant/action/builtin/cleanup_disks.rb +59 -0
- data/lib/vagrant/action/builtin/cloud_init_setup.rb +125 -0
- data/lib/vagrant/action/builtin/cloud_init_wait.rb +35 -0
- data/lib/vagrant/action/builtin/config_validate.rb +33 -0
- data/lib/vagrant/action/builtin/confirm.rb +51 -0
- data/lib/vagrant/action/builtin/delayed.rb +29 -0
- data/lib/vagrant/action/builtin/destroy_confirm.rb +24 -0
- data/lib/vagrant/action/builtin/disk.rb +55 -0
- data/lib/vagrant/action/builtin/env_set.rb +27 -0
- data/lib/vagrant/action/builtin/graceful_halt.rb +88 -0
- data/lib/vagrant/action/builtin/handle_box.rb +111 -0
- data/lib/vagrant/action/builtin/handle_box_url.rb +17 -0
- data/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +300 -0
- data/lib/vagrant/action/builtin/has_provisioner.rb +39 -0
- data/lib/vagrant/action/builtin/is_env_set.rb +25 -0
- data/lib/vagrant/action/builtin/is_state.rb +35 -0
- data/lib/vagrant/action/builtin/lock.rb +60 -0
- data/lib/vagrant/action/builtin/message.rb +29 -0
- data/lib/vagrant/action/builtin/mixin_provisioners.rb +159 -0
- data/lib/vagrant/action/builtin/mixin_synced_folders.rb +267 -0
- data/lib/vagrant/action/builtin/prepare_clone.rb +41 -0
- data/lib/vagrant/action/builtin/provision.rb +146 -0
- data/lib/vagrant/action/builtin/provisioner_cleanup.rb +57 -0
- data/lib/vagrant/action/builtin/set_hostname.rb +34 -0
- data/lib/vagrant/action/builtin/ssh_exec.rb +47 -0
- data/lib/vagrant/action/builtin/ssh_run.rb +88 -0
- data/lib/vagrant/action/builtin/synced_folder_cleanup.rb +36 -0
- data/lib/vagrant/action/builtin/synced_folders.rb +154 -0
- data/lib/vagrant/action/builtin/trigger.rb +40 -0
- data/lib/vagrant/action/builtin/wait_for_communicator.rb +82 -0
- data/lib/vagrant/action/general/package.rb +176 -29
- data/lib/vagrant/action/general/package_setup_files.rb +54 -0
- data/lib/vagrant/action/general/package_setup_folders.rb +40 -0
- data/lib/vagrant/action/hook.rb +163 -0
- data/lib/vagrant/action/primary_runner.rb +18 -0
- data/lib/vagrant/action/runner.rb +72 -13
- data/lib/vagrant/action/warden.rb +54 -20
- data/lib/vagrant/action.rb +74 -49
- data/lib/vagrant/alias.rb +59 -0
- data/lib/vagrant/batch_action.rb +181 -0
- data/lib/vagrant/box.rb +242 -26
- data/lib/vagrant/box_collection.rb +540 -35
- data/lib/vagrant/box_metadata.rb +275 -0
- data/lib/vagrant/bundler.rb +936 -0
- data/lib/vagrant/capability_host.rb +180 -0
- data/lib/vagrant/cli.rb +75 -29
- data/lib/vagrant/config/loader.rb +241 -45
- data/lib/vagrant/config/v1/dummy_config.rb +16 -0
- data/lib/vagrant/config/v1/loader.rb +108 -0
- data/lib/vagrant/config/v1/root.rb +63 -0
- data/lib/vagrant/config/v1.rb +12 -0
- data/lib/vagrant/config/v2/dummy_config.rb +60 -0
- data/lib/vagrant/config/v2/loader.rb +154 -0
- data/lib/vagrant/config/v2/root.rb +122 -0
- data/lib/vagrant/config/v2/util.rb +24 -0
- data/lib/vagrant/config/v2.rb +13 -0
- data/lib/vagrant/config/version_base.rb +83 -0
- data/lib/vagrant/config.rb +26 -11
- data/lib/vagrant/environment.rb +1019 -311
- data/lib/vagrant/errors.rb +853 -140
- data/lib/vagrant/guest.rb +68 -14
- data/lib/vagrant/host.rb +19 -0
- data/lib/vagrant/machine.rb +672 -0
- data/lib/vagrant/machine_index.rb +527 -0
- data/lib/vagrant/machine_state.rb +54 -0
- data/lib/vagrant/patches/builder/mkmf.rb +116 -0
- data/lib/vagrant/patches/fake_ftp.rb +28 -0
- data/lib/vagrant/patches/log4r.rb +54 -0
- data/lib/vagrant/patches/net-ssh.rb +76 -0
- data/lib/vagrant/patches/rubygems.rb +23 -0
- data/lib/vagrant/patches/timeout_error.rb +5 -0
- data/lib/vagrant/plugin/manager.rb +406 -0
- data/lib/vagrant/plugin/state_file.rb +136 -0
- data/lib/vagrant/plugin/v1/command.rb +171 -0
- data/lib/vagrant/plugin/v1/communicator.rb +101 -0
- data/lib/vagrant/plugin/v1/config.rb +115 -0
- data/lib/vagrant/plugin/v1/errors.rb +18 -0
- data/lib/vagrant/plugin/v1/guest.rb +95 -0
- data/lib/vagrant/plugin/v1/host.rb +69 -0
- data/lib/vagrant/plugin/v1/manager.rb +134 -0
- data/lib/vagrant/plugin/v1/plugin.rb +231 -0
- data/lib/vagrant/plugin/v1/provider.rb +71 -0
- data/lib/vagrant/plugin/v1/provisioner.rb +53 -0
- data/lib/vagrant/plugin/v1.rb +25 -0
- data/lib/vagrant/plugin/v2/command.rb +309 -0
- data/lib/vagrant/plugin/v2/communicator.rb +133 -0
- data/lib/vagrant/plugin/v2/components.rb +94 -0
- data/lib/vagrant/plugin/v2/config.rb +167 -0
- data/lib/vagrant/plugin/v2/errors.rb +18 -0
- data/lib/vagrant/plugin/v2/guest.rb +26 -0
- data/lib/vagrant/plugin/v2/host.rb +22 -0
- data/lib/vagrant/plugin/v2/manager.rb +306 -0
- data/lib/vagrant/plugin/v2/plugin.rb +296 -0
- data/lib/vagrant/plugin/v2/provider.rb +118 -0
- data/lib/vagrant/plugin/v2/provisioner.rb +56 -0
- data/lib/vagrant/plugin/v2/push.rb +30 -0
- data/lib/vagrant/plugin/v2/synced_folder.rb +113 -0
- data/lib/vagrant/plugin/v2/trigger.rb +367 -0
- data/lib/vagrant/plugin/v2.rb +33 -0
- data/lib/vagrant/plugin.rb +7 -77
- data/lib/vagrant/registry.rb +79 -18
- data/lib/vagrant/shared_helpers.rb +238 -0
- data/lib/vagrant/ui.rb +334 -53
- data/lib/vagrant/util/ansi_escape_code_remover.rb +4 -1
- data/lib/vagrant/util/busy.rb +4 -1
- data/lib/vagrant/util/caps.rb +51 -0
- data/lib/vagrant/util/checkpoint_client.rb +186 -0
- data/lib/vagrant/util/command_deprecation.rb +59 -0
- data/lib/vagrant/util/counter.rb +3 -0
- data/lib/vagrant/util/credential_scrubber.rb +74 -0
- data/lib/vagrant/util/curl_helper.rb +104 -0
- data/lib/vagrant/util/deep_merge.rb +23 -0
- data/lib/vagrant/util/directory.rb +22 -0
- data/lib/vagrant/util/downloader.rb +278 -0
- data/lib/vagrant/util/env.rb +56 -0
- data/lib/vagrant/util/experimental.rb +79 -0
- data/lib/vagrant/util/file_checksum.rb +47 -8
- data/lib/vagrant/util/file_mode.rb +3 -0
- data/lib/vagrant/util/file_mutex.rb +50 -0
- data/lib/vagrant/util/guest_hosts.rb +71 -0
- data/lib/vagrant/util/guest_inspection.rb +118 -0
- data/lib/vagrant/util/guest_networks.rb +107 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +3 -0
- data/lib/vagrant/util/install_cli_autocomplete.rb +121 -0
- data/lib/vagrant/util/io.rb +53 -0
- data/lib/vagrant/util/ipv4_interfaces.rb +18 -0
- data/lib/vagrant/util/is_port_open.rb +12 -19
- data/lib/vagrant/util/keypair.rb +293 -0
- data/lib/vagrant/util/line_buffer.rb +63 -0
- data/lib/vagrant/util/line_ending_helpers.rb +3 -0
- data/lib/vagrant/util/logging_formatter.rb +70 -0
- data/lib/vagrant/util/map_command_options.rb +36 -0
- data/lib/vagrant/util/mime.rb +95 -0
- data/lib/vagrant/util/network_ip.rb +16 -17
- data/lib/vagrant/util/numeric.rb +92 -0
- data/lib/vagrant/util/platform.rb +695 -26
- data/lib/vagrant/util/powershell.rb +316 -0
- data/lib/vagrant/util/presence.rb +48 -0
- data/lib/vagrant/util/retryable.rb +11 -2
- data/lib/vagrant/util/safe_chdir.rb +36 -0
- data/lib/vagrant/util/safe_env.rb +17 -0
- data/lib/vagrant/util/safe_exec.rb +49 -7
- data/lib/vagrant/util/safe_puts.rb +5 -2
- data/lib/vagrant/util/scoped_hash_override.rb +47 -0
- data/lib/vagrant/util/shell_quote.rb +18 -0
- data/lib/vagrant/util/silence_warnings.rb +17 -0
- data/lib/vagrant/util/ssh.rb +267 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +4 -1
- data/lib/vagrant/util/string_block_editor.rb +80 -0
- data/lib/vagrant/util/subprocess.rb +199 -81
- data/lib/vagrant/util/template_renderer.rb +14 -6
- data/lib/vagrant/util/uploader.rb +109 -0
- data/lib/vagrant/util/which.rb +56 -0
- data/lib/vagrant/util/windows_path.rb +41 -0
- data/lib/vagrant/util.rb +51 -0
- data/lib/vagrant/vagrantfile.rb +320 -0
- data/lib/vagrant/version.rb +5 -1
- data/lib/vagrant.rb +327 -144
- data/plugins/README.md +11 -0
- data/plugins/commands/autocomplete/command/install.rb +52 -0
- data/plugins/commands/autocomplete/command/root.rb +69 -0
- data/plugins/commands/autocomplete/plugin.rb +21 -0
- data/plugins/commands/box/command/add.rb +111 -0
- data/plugins/commands/box/command/download_mixins.rb +32 -0
- data/plugins/commands/box/command/list.rb +82 -0
- data/plugins/commands/box/command/outdated.rb +109 -0
- data/plugins/commands/box/command/prune.rb +136 -0
- data/plugins/commands/box/command/remove.rb +83 -0
- data/plugins/commands/box/command/repackage.rb +46 -0
- data/plugins/commands/box/command/root.rb +98 -0
- data/plugins/commands/box/command/update.rb +206 -0
- data/plugins/commands/box/plugin.rb +18 -0
- data/plugins/commands/cap/command.rb +83 -0
- data/plugins/commands/cap/plugin.rb +20 -0
- data/plugins/commands/cloud/auth/login.rb +90 -0
- data/plugins/commands/cloud/auth/logout.rb +37 -0
- data/plugins/commands/cloud/auth/middleware/add_authentication.rb +116 -0
- data/plugins/commands/cloud/auth/middleware/add_downloader_authentication.rb +68 -0
- data/plugins/commands/cloud/auth/plugin.rb +23 -0
- data/plugins/commands/cloud/auth/root.rb +77 -0
- data/plugins/commands/cloud/auth/whoami.rb +63 -0
- data/plugins/commands/cloud/box/create.rb +82 -0
- data/plugins/commands/cloud/box/delete.rb +74 -0
- data/plugins/commands/cloud/box/plugin.rb +22 -0
- data/plugins/commands/cloud/box/root.rb +81 -0
- data/plugins/commands/cloud/box/show.rb +133 -0
- data/plugins/commands/cloud/box/update.rb +82 -0
- data/plugins/commands/cloud/client/client.rb +257 -0
- data/plugins/commands/cloud/errors.rb +31 -0
- data/plugins/commands/cloud/list.rb +54 -0
- data/plugins/commands/cloud/locales/en.yml +197 -0
- data/plugins/commands/cloud/plugin.rb +48 -0
- data/plugins/commands/cloud/provider/create.rb +105 -0
- data/plugins/commands/cloud/provider/delete.rb +109 -0
- data/plugins/commands/cloud/provider/plugin.rb +22 -0
- data/plugins/commands/cloud/provider/root.rb +81 -0
- data/plugins/commands/cloud/provider/update.rb +102 -0
- data/plugins/commands/cloud/provider/upload.rb +100 -0
- data/plugins/commands/cloud/publish.rb +297 -0
- data/plugins/commands/cloud/root.rb +108 -0
- data/plugins/commands/cloud/search.rb +102 -0
- data/plugins/commands/cloud/util.rb +371 -0
- data/plugins/commands/cloud/version/create.rb +77 -0
- data/plugins/commands/cloud/version/delete.rb +78 -0
- data/plugins/commands/cloud/version/plugin.rb +22 -0
- data/plugins/commands/cloud/version/release.rb +78 -0
- data/plugins/commands/cloud/version/revoke.rb +79 -0
- data/plugins/commands/cloud/version/root.rb +85 -0
- data/plugins/commands/cloud/version/update.rb +76 -0
- data/plugins/commands/destroy/command.rb +79 -0
- data/plugins/commands/destroy/plugin.rb +21 -0
- data/plugins/commands/global-status/command.rb +114 -0
- data/plugins/commands/global-status/plugin.rb +21 -0
- data/plugins/commands/halt/command.rb +42 -0
- data/plugins/commands/halt/plugin.rb +21 -0
- data/plugins/commands/help/command.rb +19 -0
- data/plugins/commands/help/plugin.rb +20 -0
- data/plugins/commands/init/command.rb +110 -0
- data/plugins/commands/init/plugin.rb +21 -0
- data/plugins/commands/list-commands/command.rb +46 -0
- data/plugins/commands/list-commands/plugin.rb +21 -0
- data/plugins/commands/login/plugin.rb +20 -0
- data/plugins/commands/package/command.rb +104 -0
- data/plugins/commands/package/plugin.rb +21 -0
- data/plugins/commands/plugin/action/expunge_plugins.rb +77 -0
- data/plugins/commands/plugin/action/install_gem.rb +80 -0
- data/plugins/commands/plugin/action/license_plugin.rb +48 -0
- data/plugins/commands/plugin/action/list_plugins.rb +79 -0
- data/plugins/commands/plugin/action/plugin_exists_check.rb +28 -0
- data/plugins/commands/plugin/action/repair_plugins.rb +67 -0
- data/plugins/commands/plugin/action/uninstall_plugin.rb +28 -0
- data/plugins/commands/plugin/action/update_gems.rb +52 -0
- data/plugins/commands/plugin/action.rb +82 -0
- data/plugins/commands/plugin/command/base.rb +22 -0
- data/plugins/commands/plugin/command/expunge.rb +95 -0
- data/plugins/commands/plugin/command/install.rb +90 -0
- data/plugins/commands/plugin/command/license.rb +34 -0
- data/plugins/commands/plugin/command/list.rb +34 -0
- data/plugins/commands/plugin/command/mixin_install_opts.rb +34 -0
- data/plugins/commands/plugin/command/repair.rb +41 -0
- data/plugins/commands/plugin/command/root.rb +98 -0
- data/plugins/commands/plugin/command/uninstall.rb +38 -0
- data/plugins/commands/plugin/command/update.rb +42 -0
- data/plugins/commands/plugin/gem_helper.rb +89 -0
- data/plugins/commands/plugin/plugin.rb +23 -0
- data/plugins/commands/port/command.rb +91 -0
- data/plugins/commands/port/locales/en.yml +23 -0
- data/plugins/commands/port/plugin.rb +30 -0
- data/plugins/commands/powershell/command.rb +132 -0
- data/plugins/commands/powershell/errors.rb +29 -0
- data/plugins/commands/powershell/plugin.rb +34 -0
- data/plugins/commands/powershell/scripts/enable_psremoting.ps1 +63 -0
- data/plugins/commands/powershell/scripts/reset_trustedhosts.ps1 +15 -0
- data/plugins/commands/provider/command.rb +77 -0
- data/plugins/commands/provider/plugin.rb +21 -0
- data/plugins/commands/provision/command.rb +41 -0
- data/plugins/commands/provision/plugin.rb +21 -0
- data/plugins/commands/push/command.rb +78 -0
- data/plugins/commands/push/plugin.rb +20 -0
- data/plugins/commands/rdp/command.rb +114 -0
- data/plugins/commands/rdp/config.rb +29 -0
- data/plugins/commands/rdp/errors.rb +21 -0
- data/plugins/commands/rdp/plugin.rb +39 -0
- data/plugins/commands/reload/command.rb +67 -0
- data/plugins/commands/reload/plugin.rb +21 -0
- data/plugins/commands/resume/command.rb +46 -0
- data/plugins/commands/resume/plugin.rb +20 -0
- data/plugins/commands/snapshot/command/delete.rb +50 -0
- data/plugins/commands/snapshot/command/list.rb +50 -0
- data/plugins/commands/snapshot/command/pop.rb +52 -0
- data/plugins/commands/snapshot/command/push.rb +36 -0
- data/plugins/commands/snapshot/command/push_shared.rb +58 -0
- data/plugins/commands/snapshot/command/restore.rb +67 -0
- data/plugins/commands/snapshot/command/root.rb +95 -0
- data/plugins/commands/snapshot/command/save.rb +75 -0
- data/plugins/commands/snapshot/plugin.rb +18 -0
- data/plugins/commands/ssh/command.rb +80 -0
- data/plugins/commands/ssh/plugin.rb +20 -0
- data/plugins/commands/ssh_config/command.rb +78 -0
- data/plugins/commands/ssh_config/plugin.rb +21 -0
- data/plugins/commands/status/command.rb +59 -0
- data/plugins/commands/status/plugin.rb +21 -0
- data/plugins/commands/suspend/command.rb +49 -0
- data/plugins/commands/suspend/plugin.rb +21 -0
- data/plugins/commands/up/command.rb +194 -0
- data/plugins/commands/up/middleware/store_box_metadata.rb +40 -0
- data/plugins/commands/up/plugin.rb +25 -0
- data/plugins/commands/up/start_mixins.rb +58 -0
- data/plugins/commands/upload/command.rb +239 -0
- data/plugins/commands/upload/plugin.rb +20 -0
- data/plugins/commands/validate/command.rb +107 -0
- data/plugins/commands/validate/plugin.rb +20 -0
- data/plugins/commands/version/command.rb +60 -0
- data/plugins/commands/version/plugin.rb +21 -0
- data/plugins/commands/winrm/command.rb +71 -0
- data/plugins/commands/winrm/plugin.rb +20 -0
- data/plugins/commands/winrm_config/command.rb +129 -0
- data/plugins/commands/winrm_config/plugin.rb +20 -0
- data/plugins/communicators/ssh/communicator.rb +898 -0
- data/plugins/communicators/ssh/plugin.rb +22 -0
- data/plugins/communicators/winrm/command_filter.rb +49 -0
- data/plugins/communicators/winrm/command_filters/cat.rb +26 -0
- data/plugins/communicators/winrm/command_filters/chmod.rb +20 -0
- data/plugins/communicators/winrm/command_filters/chown.rb +20 -0
- data/plugins/communicators/winrm/command_filters/grep.rb +26 -0
- data/plugins/communicators/winrm/command_filters/mkdir.rb +30 -0
- data/plugins/communicators/winrm/command_filters/rm.rb +50 -0
- data/plugins/communicators/winrm/command_filters/test.rb +68 -0
- data/plugins/communicators/winrm/command_filters/uname.rb +30 -0
- data/plugins/communicators/winrm/command_filters/which.rb +27 -0
- data/plugins/communicators/winrm/communicator.rb +230 -0
- data/plugins/communicators/winrm/config.rb +76 -0
- data/plugins/communicators/winrm/errors.rb +72 -0
- data/plugins/communicators/winrm/helper.rb +91 -0
- data/plugins/communicators/winrm/plugin.rb +69 -0
- data/plugins/communicators/winrm/shell.rb +267 -0
- data/plugins/communicators/winssh/communicator.rb +252 -0
- data/plugins/communicators/winssh/config.rb +37 -0
- data/plugins/communicators/winssh/plugin.rb +24 -0
- data/plugins/guests/alma/cap/flavor.rb +26 -0
- data/plugins/guests/alma/guest.rb +13 -0
- data/plugins/guests/alma/plugin.rb +23 -0
- data/plugins/guests/alpine/cap/change_host_name.rb +85 -0
- data/plugins/guests/alpine/cap/configure_networks.rb +67 -0
- data/plugins/guests/alpine/cap/halt.rb +24 -0
- data/plugins/guests/alpine/cap/nfs_client.rb +17 -0
- data/plugins/guests/alpine/cap/rsync.rb +20 -0
- data/plugins/guests/alpine/cap/smb.rb +16 -0
- data/plugins/guests/alpine/guest.rb +14 -0
- data/plugins/guests/alpine/plugin.rb +69 -0
- data/plugins/guests/alt/cap/change_host_name.rb +55 -0
- data/plugins/guests/alt/cap/configure_networks.rb +132 -0
- data/plugins/guests/alt/cap/flavor.rb +66 -0
- data/plugins/guests/alt/cap/network_scripts_dir.rb +14 -0
- data/plugins/guests/alt/cap/rsync.rb +16 -0
- data/plugins/guests/alt/guest.rb +12 -0
- data/plugins/guests/alt/plugin.rb +43 -0
- data/plugins/guests/amazon/cap/configure_networks.rb +26 -0
- data/plugins/guests/amazon/cap/flavor.rb +17 -0
- data/plugins/guests/amazon/guest.rb +12 -0
- data/plugins/guests/amazon/plugin.rb +28 -0
- data/plugins/guests/arch/cap/change_host_name.rb +18 -0
- data/plugins/guests/arch/cap/configure_networks.rb +81 -0
- data/plugins/guests/arch/cap/nfs.rb +36 -0
- data/plugins/guests/arch/cap/rsync.rb +19 -0
- data/plugins/guests/arch/cap/smb.rb +20 -0
- data/plugins/guests/arch/guest.rb +14 -0
- data/plugins/guests/arch/plugin.rb +53 -0
- data/plugins/guests/atomic/cap/change_host_name.rb +18 -0
- data/plugins/guests/atomic/cap/docker.rb +14 -0
- data/plugins/guests/atomic/guest.rb +14 -0
- data/plugins/guests/atomic/plugin.rb +28 -0
- data/plugins/guests/bsd/cap/file_system.rb +80 -0
- data/plugins/guests/bsd/cap/halt.rb +19 -0
- data/plugins/guests/bsd/cap/mount_virtualbox_shared_folder.rb +19 -0
- data/plugins/guests/bsd/cap/nfs.rb +50 -0
- data/plugins/guests/bsd/cap/public_key.rb +69 -0
- data/plugins/guests/bsd/guest.rb +12 -0
- data/plugins/guests/bsd/plugin.rb +58 -0
- data/plugins/guests/centos/cap/flavor.rb +32 -0
- data/plugins/guests/centos/guest.rb +14 -0
- data/plugins/guests/centos/plugin.rb +23 -0
- data/plugins/guests/coreos/cap/change_host_name.rb +41 -0
- data/plugins/guests/coreos/cap/configure_networks.rb +138 -0
- data/plugins/guests/coreos/cap/docker.rb +14 -0
- data/plugins/guests/coreos/guest.rb +14 -0
- data/plugins/guests/coreos/plugin.rb +33 -0
- data/plugins/guests/darwin/cap/change_host_name.rb +43 -0
- data/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb +23 -0
- data/plugins/guests/darwin/cap/configure_networks.rb +126 -0
- data/plugins/guests/darwin/cap/darwin_version.rb +43 -0
- data/plugins/guests/darwin/cap/halt.rb +21 -0
- data/plugins/guests/darwin/cap/mount_smb_shared_folder.rb +46 -0
- data/plugins/guests/darwin/cap/mount_vmware_shared_folder.rb +135 -0
- data/plugins/guests/darwin/cap/rsync.rb +14 -0
- data/plugins/guests/darwin/cap/shell_expand_guest_path.rb +30 -0
- data/plugins/guests/darwin/cap/verify_vmware_hgfs.rb +15 -0
- data/plugins/guests/darwin/guest.rb +18 -0
- data/plugins/guests/darwin/plugin.rb +93 -0
- data/plugins/guests/debian/cap/change_host_name.rb +110 -0
- data/plugins/guests/debian/cap/configure_networks.rb +205 -0
- data/plugins/guests/debian/cap/nfs.rb +19 -0
- data/plugins/guests/debian/cap/rsync.rb +18 -0
- data/plugins/guests/debian/cap/smb.rb +20 -0
- data/plugins/guests/debian/guest.rb +13 -0
- data/plugins/guests/debian/plugin.rb +43 -0
- data/plugins/guests/dragonflybsd/guest.rb +12 -0
- data/plugins/guests/dragonflybsd/plugin.rb +18 -0
- data/plugins/guests/elementary/guest.rb +13 -0
- data/plugins/guests/elementary/plugin.rb +18 -0
- data/plugins/guests/esxi/cap/change_host_name.rb +16 -0
- data/plugins/guests/esxi/cap/configure_networks.rb +41 -0
- data/plugins/guests/esxi/cap/halt.rb +19 -0
- data/plugins/guests/esxi/cap/mount_nfs_folder.rb +43 -0
- data/plugins/guests/esxi/cap/public_key.rb +68 -0
- data/plugins/guests/esxi/guest.rb +14 -0
- data/plugins/guests/esxi/plugin.rb +49 -0
- data/plugins/guests/fedora/cap/flavor.rb +26 -0
- data/plugins/guests/fedora/guest.rb +14 -0
- data/plugins/guests/fedora/plugin.rb +23 -0
- data/plugins/guests/freebsd/cap/change_host_name.rb +34 -0
- data/plugins/guests/freebsd/cap/configure_networks.rb +70 -0
- data/plugins/guests/freebsd/cap/mount_virtualbox_shared_folder.rb +79 -0
- data/plugins/guests/freebsd/cap/rsync.rb +18 -0
- data/plugins/guests/freebsd/cap/shell_expand_guest_path.rb +31 -0
- data/plugins/guests/freebsd/guest.rb +17 -0
- data/plugins/guests/freebsd/plugin.rb +68 -0
- data/plugins/guests/funtoo/cap/configure_networks.rb +50 -0
- data/plugins/guests/funtoo/guest.rb +12 -0
- data/plugins/guests/funtoo/plugin.rb +23 -0
- data/plugins/guests/gentoo/cap/change_host_name.rb +27 -0
- data/plugins/guests/gentoo/cap/configure_networks.rb +92 -0
- data/plugins/guests/gentoo/guest.rb +12 -0
- data/plugins/guests/gentoo/plugin.rb +28 -0
- data/plugins/guests/haiku/cap/change_host_name.rb +36 -0
- data/plugins/guests/haiku/cap/halt.rb +19 -0
- data/plugins/guests/haiku/cap/insert_public_key.rb +24 -0
- data/plugins/guests/haiku/cap/remove_public_key.rb +24 -0
- data/plugins/guests/haiku/cap/rsync.rb +22 -0
- data/plugins/guests/haiku/guest.rb +14 -0
- data/plugins/guests/haiku/plugin.rb +53 -0
- data/plugins/guests/kali/guest.rb +13 -0
- data/plugins/guests/kali/plugin.rb +18 -0
- data/plugins/guests/linux/cap/change_host_name.rb +49 -0
- data/plugins/guests/linux/cap/choose_addressable_ip_addr.rb +22 -0
- data/plugins/guests/linux/cap/file_system.rb +82 -0
- data/plugins/guests/linux/cap/halt.rb +27 -0
- data/plugins/guests/linux/cap/mount_smb_shared_folder.rb +95 -0
- data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +78 -0
- data/plugins/guests/linux/cap/network_interfaces.rb +89 -0
- data/plugins/guests/linux/cap/nfs.rb +51 -0
- data/plugins/guests/linux/cap/persist_mount_shared_folder.rb +77 -0
- data/plugins/guests/linux/cap/port.rb +14 -0
- data/plugins/guests/linux/cap/public_key.rb +65 -0
- data/plugins/guests/linux/cap/read_ip_address.rb +28 -0
- data/plugins/guests/linux/cap/reboot.rb +74 -0
- data/plugins/guests/linux/cap/rsync.rb +14 -0
- data/plugins/guests/linux/cap/shell_expand_guest_path.rb +35 -0
- data/plugins/guests/linux/guest.rb +26 -0
- data/plugins/guests/linux/plugin.rb +139 -0
- data/plugins/guests/mint/guest.rb +13 -0
- data/plugins/guests/mint/plugin.rb +18 -0
- data/plugins/guests/netbsd/cap/change_host_name.rb +20 -0
- data/plugins/guests/netbsd/cap/configure_networks.rb +56 -0
- data/plugins/guests/netbsd/cap/rsync.rb +23 -0
- data/plugins/guests/netbsd/cap/shell_expand_guest_path.rb +30 -0
- data/plugins/guests/netbsd/guest.rb +14 -0
- data/plugins/guests/netbsd/plugin.rb +58 -0
- data/plugins/guests/nixos/cap/change_host_name.rb +47 -0
- data/plugins/guests/nixos/cap/configure_networks.rb +135 -0
- data/plugins/guests/nixos/cap/nfs_client.rb +14 -0
- data/plugins/guests/nixos/guest.rb +20 -0
- data/plugins/guests/nixos/plugin.rb +33 -0
- data/plugins/guests/omnios/cap/change_host_name.rb +23 -0
- data/plugins/guests/omnios/cap/mount_nfs_folder.rb +24 -0
- data/plugins/guests/omnios/cap/rsync.rb +14 -0
- data/plugins/guests/omnios/guest.rb +12 -0
- data/plugins/guests/omnios/plugin.rb +33 -0
- data/plugins/guests/openbsd/cap/change_host_name.rb +35 -0
- data/plugins/guests/openbsd/cap/configure_networks.rb +49 -0
- data/plugins/guests/openbsd/cap/halt.rb +22 -0
- data/plugins/guests/openbsd/cap/rsync.rb +32 -0
- data/plugins/guests/openbsd/cap/shell_expand_guest_path.rb +30 -0
- data/plugins/guests/openbsd/guest.rb +14 -0
- data/plugins/guests/openbsd/plugin.rb +63 -0
- data/plugins/guests/openwrt/cap/change_host_name.rb +22 -0
- data/plugins/guests/openwrt/cap/halt.rb +19 -0
- data/plugins/guests/openwrt/cap/insert_public_key.rb +23 -0
- data/plugins/guests/openwrt/cap/remove_public_key.rb +25 -0
- data/plugins/guests/openwrt/cap/rsync.rb +38 -0
- data/plugins/guests/openwrt/guest.rb +26 -0
- data/plugins/guests/openwrt/plugin.rb +64 -0
- data/plugins/guests/photon/cap/change_host_name.rb +22 -0
- data/plugins/guests/photon/cap/configure_networks.rb +33 -0
- data/plugins/guests/photon/cap/docker.rb +14 -0
- data/plugins/guests/photon/guest.rb +12 -0
- data/plugins/guests/photon/plugin.rb +33 -0
- data/plugins/guests/pld/cap/change_host_name.rb +26 -0
- data/plugins/guests/pld/cap/flavor.rb +14 -0
- data/plugins/guests/pld/cap/network_scripts_dir.rb +14 -0
- data/plugins/guests/pld/guest.rb +12 -0
- data/plugins/guests/pld/plugin.rb +33 -0
- data/plugins/guests/redhat/cap/change_host_name.rb +59 -0
- data/plugins/guests/redhat/cap/configure_networks.rb +113 -0
- data/plugins/guests/redhat/cap/flavor.rb +32 -0
- data/plugins/guests/redhat/cap/network_scripts_dir.rb +18 -0
- data/plugins/guests/redhat/cap/nfs_client.rb +33 -0
- data/plugins/guests/redhat/cap/rsync.rb +20 -0
- data/plugins/guests/redhat/cap/smb.rb +23 -0
- data/plugins/guests/redhat/guest.rb +12 -0
- data/plugins/guests/redhat/plugin.rb +53 -0
- data/plugins/guests/rocky/cap/flavor.rb +26 -0
- data/plugins/guests/rocky/guest.rb +13 -0
- data/plugins/guests/rocky/plugin.rb +23 -0
- data/plugins/guests/slackware/cap/change_host_name.rb +24 -0
- data/plugins/guests/slackware/cap/configure_networks.rb +51 -0
- data/plugins/guests/slackware/guest.rb +12 -0
- data/plugins/guests/slackware/plugin.rb +28 -0
- data/plugins/guests/smartos/cap/change_host_name.rb +29 -0
- data/plugins/guests/smartos/cap/configure_networks.rb +30 -0
- data/plugins/guests/smartos/cap/halt.rb +25 -0
- data/plugins/guests/smartos/cap/insert_public_key.rb +31 -0
- data/plugins/guests/smartos/cap/mount_nfs.rb +31 -0
- data/plugins/guests/smartos/cap/remove_public_key.rb +28 -0
- data/plugins/guests/smartos/cap/rsync.rb +36 -0
- data/plugins/guests/smartos/config.rb +18 -0
- data/plugins/guests/smartos/guest.rb +14 -0
- data/plugins/guests/smartos/plugin.rb +74 -0
- data/plugins/guests/solaris/cap/change_host_name.rb +20 -0
- data/plugins/guests/solaris/cap/configure_networks.rb +28 -0
- data/plugins/guests/solaris/cap/file_system.rb +80 -0
- data/plugins/guests/solaris/cap/halt.rb +25 -0
- data/plugins/guests/solaris/cap/insert_public_key.rb +25 -0
- data/plugins/guests/solaris/cap/mount_virtualbox_shared_folder.rb +44 -0
- data/plugins/guests/solaris/cap/remove_public_key.rb +25 -0
- data/plugins/guests/solaris/cap/rsync.rb +36 -0
- data/plugins/guests/solaris/config.rb +34 -0
- data/plugins/guests/solaris/guest.rb +17 -0
- data/plugins/guests/solaris/plugin.rb +88 -0
- data/plugins/guests/solaris11/cap/change_host_name.rb +26 -0
- data/plugins/guests/solaris11/cap/configure_networks.rb +37 -0
- data/plugins/guests/solaris11/config.rb +37 -0
- data/plugins/guests/solaris11/guest.rb +22 -0
- data/plugins/guests/solaris11/plugin.rb +42 -0
- data/plugins/guests/suse/cap/change_host_name.rb +48 -0
- data/plugins/guests/suse/cap/configure_networks.rb +53 -0
- data/plugins/guests/suse/cap/halt.rb +23 -0
- data/plugins/guests/suse/cap/network_scripts_dir.rb +14 -0
- data/plugins/guests/suse/cap/nfs_client.rb +18 -0
- data/plugins/guests/suse/cap/rsync.rb +18 -0
- data/plugins/guests/suse/guest.rb +12 -0
- data/plugins/guests/suse/plugin.rb +53 -0
- data/plugins/guests/tinycore/cap/change_host_name.rb +16 -0
- data/plugins/guests/tinycore/cap/configure_networks.rb +29 -0
- data/plugins/guests/tinycore/cap/halt.rb +19 -0
- data/plugins/guests/tinycore/cap/mount_nfs.rb +44 -0
- data/plugins/guests/tinycore/cap/rsync.rb +20 -0
- data/plugins/guests/tinycore/guest.rb +13 -0
- data/plugins/guests/tinycore/plugin.rb +43 -0
- data/plugins/guests/trisquel/guest.rb +12 -0
- data/plugins/guests/trisquel/plugin.rb +18 -0
- data/plugins/guests/ubuntu/guest.rb +13 -0
- data/plugins/guests/ubuntu/plugin.rb +18 -0
- data/plugins/guests/windows/cap/change_host_name.rb +36 -0
- data/plugins/guests/windows/cap/choose_addressable_ip_addr.rb +23 -0
- data/plugins/guests/windows/cap/configure_networks.rb +83 -0
- data/plugins/guests/windows/cap/file_system.rb +68 -0
- data/plugins/guests/windows/cap/halt.rb +19 -0
- data/plugins/guests/windows/cap/mount_shared_folder.rb +60 -0
- data/plugins/guests/windows/cap/public_key.rb +87 -0
- data/plugins/guests/windows/cap/reboot.rb +63 -0
- data/plugins/guests/windows/cap/rsync.rb +29 -0
- data/plugins/guests/windows/config.rb +26 -0
- data/plugins/guests/windows/errors.rb +25 -0
- data/plugins/guests/windows/guest.rb +13 -0
- data/plugins/guests/windows/guest_network.rb +128 -0
- data/plugins/guests/windows/plugin.rb +116 -0
- data/plugins/guests/windows/scripts/mount_volume.ps1.erb +48 -0
- data/plugins/guests/windows/scripts/reboot_detect.ps1 +50 -0
- data/plugins/guests/windows/scripts/set_work_network.ps1 +9 -0
- data/plugins/guests/windows/scripts/winrs_v3_get_adapters.ps1 +14 -0
- data/plugins/hosts/alt/cap/nfs.rb +46 -0
- data/plugins/hosts/alt/host.rb +14 -0
- data/plugins/hosts/alt/plugin.rb +35 -0
- data/plugins/hosts/arch/cap/nfs.rb +22 -0
- data/plugins/hosts/arch/host.rb +14 -0
- data/plugins/hosts/arch/plugin.rb +35 -0
- data/plugins/hosts/bsd/cap/nfs.rb +218 -0
- data/plugins/hosts/bsd/cap/path.rb +14 -0
- data/plugins/hosts/bsd/cap/ssh.rb +19 -0
- data/plugins/hosts/bsd/host.rb +15 -0
- data/plugins/hosts/bsd/plugin.rb +63 -0
- data/plugins/hosts/darwin/cap/configured_ip_addresses.rb +21 -0
- data/plugins/hosts/darwin/cap/fs_iso.rb +52 -0
- data/plugins/hosts/darwin/cap/nfs.rb +14 -0
- data/plugins/hosts/darwin/cap/path.rb +66 -0
- data/plugins/hosts/darwin/cap/provider_install_virtualbox.rb +64 -0
- data/plugins/hosts/darwin/cap/rdp.rb +64 -0
- data/plugins/hosts/darwin/cap/smb.rb +128 -0
- data/plugins/hosts/darwin/cap/version.rb +26 -0
- data/plugins/hosts/darwin/host.rb +14 -0
- data/plugins/hosts/darwin/plugin.rb +83 -0
- data/plugins/hosts/darwin/scripts/install_virtualbox.sh +18 -0
- data/plugins/hosts/freebsd/cap/nfs.rb +34 -0
- data/plugins/hosts/freebsd/host.rb +15 -0
- data/plugins/hosts/freebsd/plugin.rb +34 -0
- data/plugins/hosts/gentoo/cap/nfs.rb +42 -0
- data/plugins/hosts/gentoo/host.rb +14 -0
- data/plugins/hosts/gentoo/plugin.rb +31 -0
- data/plugins/hosts/linux/cap/fs_iso.rb +52 -0
- data/plugins/hosts/linux/cap/nfs.rb +296 -0
- data/plugins/hosts/linux/cap/rdp.rb +59 -0
- data/plugins/hosts/linux/cap/ssh.rb +19 -0
- data/plugins/hosts/linux/host.rb +15 -0
- data/plugins/hosts/linux/plugin.rb +70 -0
- data/plugins/hosts/null/host.rb +15 -0
- data/plugins/hosts/null/plugin.rb +18 -0
- data/plugins/hosts/redhat/cap/nfs.rb +58 -0
- data/plugins/hosts/redhat/host.rb +31 -0
- data/plugins/hosts/redhat/plugin.rb +30 -0
- data/plugins/hosts/slackware/cap/nfs.rb +18 -0
- data/plugins/hosts/slackware/host.rb +15 -0
- data/plugins/hosts/slackware/plugin.rb +30 -0
- data/plugins/hosts/suse/cap/nfs.rb +22 -0
- data/plugins/hosts/suse/host.rb +30 -0
- data/plugins/hosts/suse/plugin.rb +33 -0
- data/plugins/hosts/void/cap/nfs.rb +27 -0
- data/plugins/hosts/void/host.rb +23 -0
- data/plugins/hosts/void/plugin.rb +33 -0
- data/plugins/hosts/windows/cap/configured_ip_addresses.rb +32 -0
- data/plugins/hosts/windows/cap/fs_iso.rb +51 -0
- data/plugins/hosts/windows/cap/nfs.rb +14 -0
- data/plugins/hosts/windows/cap/provider_install_virtualbox.rb +65 -0
- data/plugins/hosts/windows/cap/ps.rb +50 -0
- data/plugins/hosts/windows/cap/rdp.rb +33 -0
- data/plugins/hosts/windows/cap/smb.rb +203 -0
- data/plugins/hosts/windows/cap/ssh.rb +29 -0
- data/plugins/hosts/windows/host.rb +26 -0
- data/plugins/hosts/windows/plugin.rb +83 -0
- data/plugins/hosts/windows/scripts/check_credentials.ps1 +37 -0
- data/plugins/hosts/windows/scripts/host_info.ps1 +24 -0
- data/plugins/hosts/windows/scripts/install_virtualbox.ps1 +40 -0
- data/plugins/hosts/windows/scripts/set_share.ps1 +40 -0
- data/plugins/hosts/windows/scripts/set_ssh_key_permissions.ps1 +20 -0
- data/plugins/hosts/windows/scripts/unset_share.ps1 +13 -0
- data/plugins/hosts/windows/scripts/utils/VagrantSSH/VagrantSSH.psm1 +29 -0
- data/plugins/kernel_v1/config/nfs.rb +23 -0
- data/plugins/kernel_v1/config/package.rb +20 -0
- data/plugins/kernel_v1/config/ssh.rb +50 -0
- data/plugins/kernel_v1/config/vagrant.rb +34 -0
- data/plugins/kernel_v1/config/vm.rb +191 -0
- data/plugins/kernel_v1/plugin.rb +47 -0
- data/plugins/kernel_v2/config/cloud_init.rb +136 -0
- data/plugins/kernel_v2/config/disk.rb +224 -0
- data/plugins/kernel_v2/config/package.rb +24 -0
- data/plugins/kernel_v2/config/push.rb +155 -0
- data/plugins/kernel_v2/config/ssh.rb +93 -0
- data/plugins/kernel_v2/config/ssh_connect.rb +194 -0
- data/plugins/kernel_v2/config/trigger.rb +214 -0
- data/plugins/kernel_v2/config/vagrant.rb +99 -0
- data/plugins/kernel_v2/config/vm.rb +1062 -0
- data/plugins/kernel_v2/config/vm_provisioner.rb +202 -0
- data/plugins/kernel_v2/config/vm_subvm.rb +33 -0
- data/plugins/kernel_v2/config/vm_trigger.rb +297 -0
- data/plugins/kernel_v2/plugin.rb +71 -0
- data/plugins/providers/docker/action/build.rb +99 -0
- data/plugins/providers/docker/action/compare_synced_folders.rb +65 -0
- data/plugins/providers/docker/action/connect_networks.rb +80 -0
- data/plugins/providers/docker/action/create.rb +162 -0
- data/plugins/providers/docker/action/destroy.rb +34 -0
- data/plugins/providers/docker/action/destroy_build_image.rb +51 -0
- data/plugins/providers/docker/action/destroy_network.rb +53 -0
- data/plugins/providers/docker/action/forwarded_ports.rb +36 -0
- data/plugins/providers/docker/action/has_ssh.rb +21 -0
- data/plugins/providers/docker/action/host_machine.rb +75 -0
- data/plugins/providers/docker/action/host_machine_build_dir.rb +48 -0
- data/plugins/providers/docker/action/host_machine_port_checker.rb +34 -0
- data/plugins/providers/docker/action/host_machine_port_warning.rb +40 -0
- data/plugins/providers/docker/action/host_machine_required.rb +20 -0
- data/plugins/providers/docker/action/host_machine_sync_folders.rb +175 -0
- data/plugins/providers/docker/action/host_machine_sync_folders_disable.rb +91 -0
- data/plugins/providers/docker/action/init_state.rb +23 -0
- data/plugins/providers/docker/action/is_build.rb +19 -0
- data/plugins/providers/docker/action/is_host_machine_created.rb +32 -0
- data/plugins/providers/docker/action/login.rb +51 -0
- data/plugins/providers/docker/action/prepare_forwarded_port_collision_params.rb +64 -0
- data/plugins/providers/docker/action/prepare_networks.rb +372 -0
- data/plugins/providers/docker/action/prepare_nfs_settings.rb +60 -0
- data/plugins/providers/docker/action/prepare_nfs_valid_ids.rb +22 -0
- data/plugins/providers/docker/action/prepare_ssh.rb +48 -0
- data/plugins/providers/docker/action/pull.rb +30 -0
- data/plugins/providers/docker/action/start.rb +24 -0
- data/plugins/providers/docker/action/stop.rb +24 -0
- data/plugins/providers/docker/action/wait_for_running.rb +70 -0
- data/plugins/providers/docker/action.rb +319 -0
- data/plugins/providers/docker/cap/has_communicator.rb +14 -0
- data/plugins/providers/docker/cap/proxy_machine.rb +15 -0
- data/plugins/providers/docker/cap/public_address.rb +26 -0
- data/plugins/providers/docker/command/exec.rb +112 -0
- data/plugins/providers/docker/command/logs.rb +111 -0
- data/plugins/providers/docker/command/run.rb +76 -0
- data/plugins/providers/docker/communicator.rb +199 -0
- data/plugins/providers/docker/config.rb +362 -0
- data/plugins/providers/docker/driver/compose.rb +315 -0
- data/plugins/providers/docker/driver.rb +416 -0
- data/plugins/providers/docker/errors.rb +108 -0
- data/plugins/providers/docker/executor/local.rb +48 -0
- data/plugins/providers/docker/executor/vagrant.rb +88 -0
- data/plugins/providers/docker/hostmachine/Vagrantfile +3 -0
- data/plugins/providers/docker/plugin.rb +89 -0
- data/plugins/providers/docker/provider.rb +215 -0
- data/plugins/providers/docker/synced_folder.rb +35 -0
- data/plugins/providers/hyperv/action/check_access.rb +27 -0
- data/plugins/providers/hyperv/action/check_enabled.rb +25 -0
- data/plugins/providers/hyperv/action/configure.rb +115 -0
- data/plugins/providers/hyperv/action/delete_vm.rb +28 -0
- data/plugins/providers/hyperv/action/export.rb +45 -0
- data/plugins/providers/hyperv/action/import.rb +86 -0
- data/plugins/providers/hyperv/action/is_windows.rb +19 -0
- data/plugins/providers/hyperv/action/message_will_not_destroy.rb +20 -0
- data/plugins/providers/hyperv/action/net_set_mac.rb +23 -0
- data/plugins/providers/hyperv/action/net_set_vlan.rb +23 -0
- data/plugins/providers/hyperv/action/package.rb +19 -0
- data/plugins/providers/hyperv/action/package_metadata_json.rb +37 -0
- data/plugins/providers/hyperv/action/package_setup_files.rb +19 -0
- data/plugins/providers/hyperv/action/package_setup_folders.rb +21 -0
- data/plugins/providers/hyperv/action/package_vagrantfile.rb +37 -0
- data/plugins/providers/hyperv/action/read_guest_ip.rb +45 -0
- data/plugins/providers/hyperv/action/read_state.rb +33 -0
- data/plugins/providers/hyperv/action/resume_vm.rb +20 -0
- data/plugins/providers/hyperv/action/set_name.rb +46 -0
- data/plugins/providers/hyperv/action/snapshot_delete.rb +30 -0
- data/plugins/providers/hyperv/action/snapshot_restore.rb +26 -0
- data/plugins/providers/hyperv/action/snapshot_save.rb +30 -0
- data/plugins/providers/hyperv/action/start_instance.rb +20 -0
- data/plugins/providers/hyperv/action/stop_instance.rb +20 -0
- data/plugins/providers/hyperv/action/suspend_vm.rb +20 -0
- data/plugins/providers/hyperv/action/wait_for_ip_address.rb +62 -0
- data/plugins/providers/hyperv/action.rb +326 -0
- data/plugins/providers/hyperv/cap/cleanup_disks.rb +92 -0
- data/plugins/providers/hyperv/cap/configure_disks.rb +248 -0
- data/plugins/providers/hyperv/cap/public_address.rb +18 -0
- data/plugins/providers/hyperv/cap/snapshot_list.rb +14 -0
- data/plugins/providers/hyperv/cap/validate_disk_ext.rb +37 -0
- data/plugins/providers/hyperv/config.rb +148 -0
- data/plugins/providers/hyperv/driver.rb +368 -0
- data/plugins/providers/hyperv/errors.rb +49 -0
- data/plugins/providers/hyperv/plugin.rb +74 -0
- data/plugins/providers/hyperv/provider.rb +116 -0
- data/plugins/providers/hyperv/scripts/add_dvd.ps1 +18 -0
- data/plugins/providers/hyperv/scripts/attach_disk_drive.ps1 +31 -0
- data/plugins/providers/hyperv/scripts/check_hyperv.ps1 +11 -0
- data/plugins/providers/hyperv/scripts/check_hyperv_access.ps1 +17 -0
- data/plugins/providers/hyperv/scripts/clone_vhd.ps1 +21 -0
- data/plugins/providers/hyperv/scripts/configure_vm.ps1 +130 -0
- data/plugins/providers/hyperv/scripts/create_snapshot.ps1 +27 -0
- data/plugins/providers/hyperv/scripts/delete_snapshot.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/delete_vm.ps1 +22 -0
- data/plugins/providers/hyperv/scripts/dismount_vhd.ps1 +16 -0
- data/plugins/providers/hyperv/scripts/export_vm.ps1 +32 -0
- data/plugins/providers/hyperv/scripts/file_sync.ps1 +123 -0
- data/plugins/providers/hyperv/scripts/get_network_config.ps1 +68 -0
- data/plugins/providers/hyperv/scripts/get_network_mac.ps1 +35 -0
- data/plugins/providers/hyperv/scripts/get_scsi_controller.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/get_switches.ps1 +13 -0
- data/plugins/providers/hyperv/scripts/get_vhd.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/get_vm_status.ps1 +52 -0
- data/plugins/providers/hyperv/scripts/has_vmcx_support.ps1 +12 -0
- data/plugins/providers/hyperv/scripts/import_vm.ps1 +40 -0
- data/plugins/providers/hyperv/scripts/list_hdds.ps1 +20 -0
- data/plugins/providers/hyperv/scripts/list_snapshots.ps1 +22 -0
- data/plugins/providers/hyperv/scripts/new_vhd.ps1 +34 -0
- data/plugins/providers/hyperv/scripts/remove_disk_drive.ps1 +28 -0
- data/plugins/providers/hyperv/scripts/remove_dvd.ps1 +21 -0
- data/plugins/providers/hyperv/scripts/resize_disk_drive.ps1 +21 -0
- data/plugins/providers/hyperv/scripts/restore_snapshot.ps1 +20 -0
- data/plugins/providers/hyperv/scripts/resume_vm.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/set_enhanced_session_transport_type.ps1 +36 -0
- data/plugins/providers/hyperv/scripts/set_name.ps1 +27 -0
- data/plugins/providers/hyperv/scripts/set_network_mac.ps1 +21 -0
- data/plugins/providers/hyperv/scripts/set_network_vlan.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1 +30 -0
- data/plugins/providers/hyperv/scripts/start_vm.ps1 +29 -0
- data/plugins/providers/hyperv/scripts/stop_vm.ps1 +20 -0
- data/plugins/providers/hyperv/scripts/suspend_vm.ps1 +19 -0
- data/plugins/providers/hyperv/scripts/utils/VagrantMessages/VagrantMessages.psm1 +27 -0
- data/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 +776 -0
- data/plugins/providers/virtualbox/action/boot.rb +26 -0
- data/plugins/providers/virtualbox/action/check_accessible.rb +26 -0
- data/plugins/providers/virtualbox/action/check_created.rb +24 -0
- data/plugins/providers/virtualbox/action/check_guest_additions.rb +58 -0
- data/plugins/providers/virtualbox/action/check_running.rb +24 -0
- data/plugins/providers/virtualbox/action/check_virtualbox.rb +28 -0
- data/plugins/providers/virtualbox/action/clean_machine_folder.rb +55 -0
- data/plugins/providers/virtualbox/action/clear_forwarded_ports.rb +23 -0
- data/plugins/providers/virtualbox/action/clear_network_interfaces.rb +34 -0
- data/plugins/providers/virtualbox/action/created.rb +23 -0
- data/plugins/providers/virtualbox/action/customize.rb +48 -0
- data/plugins/providers/virtualbox/action/destroy.rb +22 -0
- data/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +26 -0
- data/plugins/providers/virtualbox/action/discard_state.rb +23 -0
- data/plugins/providers/virtualbox/action/export.rb +54 -0
- data/plugins/providers/virtualbox/action/forced_halt.rb +28 -0
- data/plugins/providers/virtualbox/action/forward_ports.rb +92 -0
- data/plugins/providers/virtualbox/action/import.rb +110 -0
- data/plugins/providers/virtualbox/action/import_master.rb +83 -0
- data/plugins/providers/virtualbox/action/is_paused.rb +23 -0
- data/plugins/providers/virtualbox/action/is_running.rb +23 -0
- data/plugins/providers/virtualbox/action/is_saved.rb +23 -0
- data/plugins/providers/virtualbox/action/match_mac_address.rb +30 -0
- data/plugins/providers/virtualbox/action/message_already_running.rb +19 -0
- data/plugins/providers/virtualbox/action/message_not_created.rb +19 -0
- data/plugins/providers/virtualbox/action/message_not_running.rb +19 -0
- data/plugins/providers/virtualbox/action/message_will_not_destroy.rb +20 -0
- data/plugins/providers/virtualbox/action/network.rb +638 -0
- data/plugins/providers/virtualbox/action/network_fix_ipv6.rb +87 -0
- data/plugins/providers/virtualbox/action/package.rb +19 -0
- data/plugins/providers/virtualbox/action/package_setup_files.rb +19 -0
- data/plugins/providers/virtualbox/action/package_setup_folders.rb +21 -0
- data/plugins/providers/virtualbox/action/package_vagrantfile.rb +36 -0
- data/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb +69 -0
- data/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb +38 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +162 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb +20 -0
- data/plugins/providers/virtualbox/action/resume.rb +28 -0
- data/plugins/providers/virtualbox/action/sane_defaults.rb +92 -0
- data/plugins/providers/virtualbox/action/set_default_nic_type.rb +72 -0
- data/plugins/providers/virtualbox/action/set_name.rb +58 -0
- data/plugins/providers/virtualbox/action/setup_package_files.rb +20 -0
- data/plugins/providers/virtualbox/action/snapshot_delete.rb +37 -0
- data/plugins/providers/virtualbox/action/snapshot_restore.rb +33 -0
- data/plugins/providers/virtualbox/action/snapshot_save.rb +28 -0
- data/plugins/providers/virtualbox/action/suspend.rb +23 -0
- data/plugins/providers/virtualbox/action.rb +433 -0
- data/plugins/providers/virtualbox/cap/cleanup_disks.rb +86 -0
- data/plugins/providers/virtualbox/cap/configure_disks.rb +441 -0
- data/plugins/providers/virtualbox/cap/mount_options.rb +43 -0
- data/plugins/providers/virtualbox/cap/public_address.rb +18 -0
- data/plugins/providers/virtualbox/cap/validate_disk_ext.rb +37 -0
- data/plugins/providers/virtualbox/cap.rb +40 -0
- data/plugins/providers/virtualbox/config.rb +211 -0
- data/plugins/providers/virtualbox/driver/base.rb +530 -0
- data/plugins/providers/virtualbox/driver/meta.rb +212 -0
- data/plugins/providers/virtualbox/driver/version_4_0.rb +574 -0
- data/plugins/providers/virtualbox/driver/version_4_1.rb +699 -0
- data/plugins/providers/virtualbox/driver/version_4_2.rb +713 -0
- data/plugins/providers/virtualbox/driver/version_4_3.rb +757 -0
- data/plugins/providers/virtualbox/driver/version_5_0.rb +1022 -0
- data/plugins/providers/virtualbox/driver/version_5_1.rb +19 -0
- data/plugins/providers/virtualbox/driver/version_5_2.rb +19 -0
- data/plugins/providers/virtualbox/driver/version_6_0.rb +105 -0
- data/plugins/providers/virtualbox/driver/version_6_1.rb +42 -0
- data/plugins/providers/virtualbox/driver/version_7_0.rb +306 -0
- data/plugins/providers/virtualbox/driver/version_7_1.rb +19 -0
- data/plugins/providers/virtualbox/model/forwarded_port.rb +73 -0
- data/plugins/providers/virtualbox/model/storage_controller.rb +138 -0
- data/plugins/providers/virtualbox/model/storage_controller_array.rb +101 -0
- data/plugins/providers/virtualbox/plugin.rb +120 -0
- data/plugins/providers/virtualbox/provider.rb +133 -0
- data/plugins/providers/virtualbox/synced_folder.rb +153 -0
- data/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +40 -0
- data/plugins/provisioners/ansible/cap/guest/alpine/ansible_install.rb +47 -0
- data/plugins/provisioners/ansible/cap/guest/arch/ansible_install.rb +44 -0
- data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +56 -0
- data/plugins/provisioners/ansible/cap/guest/facts.rb +27 -0
- data/plugins/provisioners/ansible/cap/guest/fedora/ansible_install.rb +43 -0
- data/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install.rb +26 -0
- data/plugins/provisioners/ansible/cap/guest/pip/pip.rb +49 -0
- data/plugins/provisioners/ansible/cap/guest/posix/ansible_installed.rb +28 -0
- data/plugins/provisioners/ansible/cap/guest/redhat/ansible_install.rb +75 -0
- data/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb +26 -0
- data/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb +42 -0
- data/plugins/provisioners/ansible/config/base.rb +157 -0
- data/plugins/provisioners/ansible/config/guest.rb +59 -0
- data/plugins/provisioners/ansible/config/host.rb +66 -0
- data/plugins/provisioners/ansible/constants.rb +17 -0
- data/plugins/provisioners/ansible/errors.rb +43 -0
- data/plugins/provisioners/ansible/helpers.rb +20 -0
- data/plugins/provisioners/ansible/plugin.rb +88 -0
- data/plugins/provisioners/ansible/provisioner/base.rb +405 -0
- data/plugins/provisioners/ansible/provisioner/guest.rb +197 -0
- data/plugins/provisioners/ansible/provisioner/host.rb +352 -0
- data/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb +24 -0
- data/plugins/provisioners/cfengine/cap/linux/cfengine_installed.rb +17 -0
- data/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb +37 -0
- data/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb +37 -0
- data/plugins/provisioners/cfengine/cap/suse/cfengine_install.rb +21 -0
- data/plugins/provisioners/cfengine/config.rb +127 -0
- data/plugins/provisioners/cfengine/plugin.rb +50 -0
- data/plugins/provisioners/cfengine/provisioner.rb +142 -0
- data/plugins/provisioners/chef/cap/debian/chef_install.rb +22 -0
- data/plugins/provisioners/chef/cap/freebsd/chef_install.rb +21 -0
- data/plugins/provisioners/chef/cap/freebsd/chef_installed.rb +27 -0
- data/plugins/provisioners/chef/cap/linux/chef_installed.rb +27 -0
- data/plugins/provisioners/chef/cap/omnios/chef_install.rb +23 -0
- data/plugins/provisioners/chef/cap/omnios/chef_installed.rb +28 -0
- data/plugins/provisioners/chef/cap/redhat/chef_install.rb +27 -0
- data/plugins/provisioners/chef/cap/suse/chef_install.rb +30 -0
- data/plugins/provisioners/chef/cap/windows/chef_install.rb +19 -0
- data/plugins/provisioners/chef/cap/windows/chef_installed.rb +24 -0
- data/plugins/provisioners/chef/command_builder.rb +87 -0
- data/plugins/provisioners/chef/config/base.rb +139 -0
- data/plugins/provisioners/chef/config/base_runner.rb +131 -0
- data/plugins/provisioners/chef/config/chef_apply.rb +53 -0
- data/plugins/provisioners/chef/config/chef_client.rb +77 -0
- data/plugins/provisioners/chef/config/chef_solo.rb +141 -0
- data/plugins/provisioners/chef/config/chef_zero.rb +133 -0
- data/plugins/provisioners/chef/installer.rb +51 -0
- data/plugins/provisioners/chef/omnibus.rb +40 -0
- data/plugins/provisioners/chef/plugin.rb +108 -0
- data/plugins/provisioners/chef/provisioner/base.rb +258 -0
- data/plugins/provisioners/chef/provisioner/chef_apply.rb +74 -0
- data/plugins/provisioners/chef/provisioner/chef_client.rb +179 -0
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +244 -0
- data/plugins/provisioners/chef/provisioner/chef_zero.rb +123 -0
- data/plugins/provisioners/container/client.rb +206 -0
- data/plugins/provisioners/container/config.rb +86 -0
- data/plugins/provisioners/container/installer.rb +16 -0
- data/plugins/provisioners/container/plugin.rb +26 -0
- data/plugins/provisioners/container/provisioner.rb +31 -0
- data/plugins/provisioners/docker/cap/centos/docker_install.rb +44 -0
- data/plugins/provisioners/docker/cap/centos/docker_start_service.rb +27 -0
- data/plugins/provisioners/docker/cap/debian/docker_install.rb +21 -0
- data/plugins/provisioners/docker/cap/debian/docker_start_service.rb +16 -0
- data/plugins/provisioners/docker/cap/fedora/docker_install.rb +30 -0
- data/plugins/provisioners/docker/cap/linux/docker_configure_vagrant_user.rb +23 -0
- data/plugins/provisioners/docker/cap/linux/docker_daemon_running.rb +16 -0
- data/plugins/provisioners/docker/cap/linux/docker_installed.rb +29 -0
- data/plugins/provisioners/docker/cap/windows/docker_daemon_running.rb +16 -0
- data/plugins/provisioners/docker/client.rb +26 -0
- data/plugins/provisioners/docker/config.rb +19 -0
- data/plugins/provisioners/docker/installer.rb +37 -0
- data/plugins/provisioners/docker/plugin.rb +71 -0
- data/plugins/provisioners/docker/provisioner.rb +59 -0
- data/plugins/provisioners/file/config.rb +32 -0
- data/plugins/provisioners/file/plugin.rb +26 -0
- data/plugins/provisioners/file/provisioner.rb +46 -0
- data/plugins/provisioners/podman/cap/centos/podman_install.rb +38 -0
- data/plugins/provisioners/podman/cap/linux/podman_installed.rb +16 -0
- data/plugins/provisioners/podman/cap/redhat/podman_install.rb +29 -0
- data/plugins/provisioners/podman/client.rb +15 -0
- data/plugins/provisioners/podman/config.rb +31 -0
- data/plugins/provisioners/podman/installer.rb +36 -0
- data/plugins/provisioners/podman/plugin.rb +41 -0
- data/plugins/provisioners/podman/provisioner.rb +55 -0
- data/plugins/provisioners/puppet/config/puppet.rb +178 -0
- data/plugins/provisioners/puppet/config/puppet_server.rb +84 -0
- data/plugins/provisioners/puppet/plugin.rb +36 -0
- data/plugins/provisioners/puppet/provisioner/puppet.rb +336 -0
- data/plugins/provisioners/puppet/provisioner/puppet_server.rb +114 -0
- data/plugins/provisioners/salt/bootstrap_downloader.rb +62 -0
- data/plugins/provisioners/salt/config.rb +194 -0
- data/plugins/provisioners/salt/errors.rb +18 -0
- data/plugins/provisioners/salt/plugin.rb +25 -0
- data/plugins/provisioners/salt/provisioner.rb +499 -0
- data/plugins/provisioners/shell/config.rb +146 -0
- data/plugins/provisioners/shell/plugin.rb +26 -0
- data/plugins/provisioners/shell/provisioner.rb +368 -0
- data/plugins/pushes/atlas/config.rb +151 -0
- data/plugins/pushes/atlas/errors.rb +16 -0
- data/plugins/pushes/atlas/locales/en.yml +25 -0
- data/plugins/pushes/atlas/plugin.rb +38 -0
- data/plugins/pushes/atlas/push.rb +87 -0
- data/plugins/pushes/ftp/adapter.rb +147 -0
- data/plugins/pushes/ftp/config.rb +133 -0
- data/plugins/pushes/ftp/errors.rb +16 -0
- data/plugins/pushes/ftp/locales/en.yml +19 -0
- data/plugins/pushes/ftp/plugin.rb +36 -0
- data/plugins/pushes/ftp/push.rb +137 -0
- data/plugins/pushes/heroku/config.rb +77 -0
- data/plugins/pushes/heroku/errors.rb +24 -0
- data/plugins/pushes/heroku/locales/en.yml +33 -0
- data/plugins/pushes/heroku/plugin.rb +36 -0
- data/plugins/pushes/heroku/push.rb +147 -0
- data/plugins/pushes/local-exec/config.rb +80 -0
- data/plugins/pushes/local-exec/errors.rb +16 -0
- data/plugins/pushes/local-exec/locales/en.yml +26 -0
- data/plugins/pushes/local-exec/plugin.rb +36 -0
- data/plugins/pushes/local-exec/push.rb +91 -0
- data/plugins/pushes/noop/config.rb +19 -0
- data/plugins/pushes/noop/plugin.rb +25 -0
- data/plugins/pushes/noop/push.rb +12 -0
- data/plugins/synced_folders/nfs/action_cleanup.rb +32 -0
- data/plugins/synced_folders/nfs/config.rb +35 -0
- data/plugins/synced_folders/nfs/plugin.rb +49 -0
- data/plugins/synced_folders/nfs/synced_folder.rb +171 -0
- data/plugins/synced_folders/rsync/command/rsync.rb +81 -0
- data/plugins/synced_folders/rsync/command/rsync_auto.rb +244 -0
- data/plugins/synced_folders/rsync/default_unix_cap.rb +49 -0
- data/plugins/synced_folders/rsync/helper.rb +296 -0
- data/plugins/synced_folders/rsync/plugin.rb +31 -0
- data/plugins/synced_folders/rsync/synced_folder.rb +62 -0
- data/plugins/synced_folders/smb/cap/default_fstab_modification.rb +14 -0
- data/plugins/synced_folders/smb/cap/mount_options.rb +59 -0
- data/plugins/synced_folders/smb/config.rb +26 -0
- data/plugins/synced_folders/smb/errors.rb +65 -0
- data/plugins/synced_folders/smb/plugin.rb +60 -0
- data/plugins/synced_folders/smb/synced_folder.rb +189 -0
- data/plugins/synced_folders/unix_mount_helpers.rb +122 -0
- data/scripts/install_rvm +19 -0
- data/scripts/setup_tests +49 -0
- data/scripts/sign.sh +29 -0
- data/scripts/website_push_www.sh +43 -0
- data/tasks/acceptance.rake +14 -105
- data/tasks/test.rake +1 -13
- data/templates/commands/init/Vagrantfile.erb +65 -78
- data/templates/commands/init/Vagrantfile.min.erb +12 -0
- data/templates/commands/ssh_config/config.erb +28 -1
- data/templates/commands/winrm_config/config.erb +11 -0
- data/templates/config/messages.erb +14 -0
- data/templates/config/validation_failed.erb +3 -3
- data/templates/guests/alpine/network_dhcp.erb +13 -0
- data/templates/guests/alpine/network_static.erb +7 -0
- data/templates/guests/alt/network_dhcp.erb +7 -0
- data/templates/guests/alt/network_ipv4address.erb +3 -0
- data/templates/guests/alt/network_ipv4route.erb +5 -0
- data/templates/guests/alt/network_static.erb +7 -0
- data/templates/guests/arch/default_network/network_dhcp.erb +4 -0
- data/templates/guests/arch/default_network/network_static.erb +8 -0
- data/templates/guests/arch/default_network/network_static6.erb +8 -0
- data/templates/guests/arch/systemd_networkd/network_dhcp.erb +6 -0
- data/templates/guests/arch/systemd_networkd/network_static.erb +9 -0
- data/templates/guests/arch/systemd_networkd/network_static6.erb +9 -0
- data/templates/guests/coreos/etcd.service.erb +10 -0
- data/templates/guests/debian/network_dhcp.erb +10 -3
- data/templates/guests/debian/network_static.erb +5 -2
- data/templates/guests/debian/network_static6.erb +10 -0
- data/templates/guests/freebsd/network_dhcp.erb +2 -1
- data/templates/guests/freebsd/network_static.erb +4 -1
- data/templates/guests/freebsd/network_static6.erb +6 -0
- data/templates/guests/funtoo/network_dhcp.erb +4 -0
- data/templates/guests/funtoo/network_static.erb +10 -0
- data/templates/guests/funtoo/network_static6.erb +9 -0
- data/templates/guests/gentoo/network_dhcp.erb +1 -1
- data/templates/guests/gentoo/network_static.erb +5 -1
- data/templates/guests/gentoo/network_static6.erb +8 -0
- data/templates/guests/gentoo/network_systemd.erb +16 -0
- data/templates/guests/linux/etc_fstab.erb +6 -0
- data/templates/guests/netbsd/network_dhcp.erb +3 -0
- data/templates/guests/netbsd/network_static.erb +3 -0
- data/templates/guests/nixos/hostname.erb +6 -0
- data/templates/guests/nixos/network.erb +15 -0
- data/templates/guests/openbsd/network_dhcp.erb +1 -0
- data/templates/guests/openbsd/network_static.erb +1 -0
- data/templates/guests/openbsd/network_static6.erb +1 -0
- data/templates/guests/redhat/network_dhcp.erb +2 -1
- data/templates/guests/redhat/network_static.erb +11 -2
- data/templates/guests/redhat/network_static6.erb +12 -0
- data/templates/guests/slackware/network_dhcp.erb +11 -0
- data/templates/guests/slackware/network_static.erb +13 -0
- data/templates/guests/suse/network_dhcp.erb +6 -0
- data/templates/guests/suse/network_static.erb +13 -0
- data/templates/guests/suse/network_static6.erb +16 -0
- data/templates/license/license.html.tmpl +127 -0
- data/templates/license/license.rtf.tmpl +0 -0
- data/templates/license/license.tmpl +92 -0
- data/templates/locales/comm_winrm.yml +85 -0
- data/templates/locales/command_ps.yml +35 -0
- data/templates/locales/command_rdp.yml +28 -0
- data/templates/locales/en.yml +2689 -299
- data/templates/locales/guest_windows.yml +26 -0
- data/templates/locales/providers_docker.yml +321 -0
- data/templates/locales/providers_hyperv.yml +111 -0
- data/templates/locales/synced_folder_smb.yml +98 -0
- data/templates/networking/network_manager/network_manager_device.erb +41 -0
- data/templates/nfs/exports_bsd.erb +5 -0
- data/templates/nfs/exports_darwin.erb +7 -0
- data/templates/nfs/exports_linux.erb +5 -3
- data/templates/provisioners/chef_client/client.erb +11 -2
- data/templates/provisioners/chef_solo/solo.erb +32 -5
- data/templates/provisioners/chef_zero/zero.erb +45 -0
- data/templates/rgloader.rb +12 -0
- data/vagrant-spec.config.example.rb +13 -0
- data/vagrant.gemspec +63 -19
- data/version.txt +1 -0
- metadata +1443 -477
- data/config/default.rb +0 -30
- data/lib/vagrant/action/box/destroy.rb +0 -25
- data/lib/vagrant/action/box/download.rb +0 -84
- data/lib/vagrant/action/box/package.rb +0 -19
- data/lib/vagrant/action/box/unpackage.rb +0 -61
- data/lib/vagrant/action/box/verify.rb +0 -23
- data/lib/vagrant/action/builtin.rb +0 -171
- data/lib/vagrant/action/env/set.rb +0 -21
- data/lib/vagrant/action/environment.rb +0 -12
- data/lib/vagrant/action/general/check_virtualbox.rb +0 -28
- data/lib/vagrant/action/general/validate.rb +0 -18
- data/lib/vagrant/action/vm/boot.rb +0 -53
- data/lib/vagrant/action/vm/check_accessible.rb +0 -23
- data/lib/vagrant/action/vm/check_box.rb +0 -33
- data/lib/vagrant/action/vm/check_guest_additions.rb +0 -38
- data/lib/vagrant/action/vm/check_port_collisions.rb +0 -89
- data/lib/vagrant/action/vm/clean_machine_folder.rb +0 -43
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +0 -18
- data/lib/vagrant/action/vm/clear_network_interfaces.rb +0 -31
- data/lib/vagrant/action/vm/clear_shared_folders.rb +0 -18
- data/lib/vagrant/action/vm/customize.rb +0 -36
- data/lib/vagrant/action/vm/default_name.rb +0 -22
- data/lib/vagrant/action/vm/destroy.rb +0 -19
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +0 -20
- data/lib/vagrant/action/vm/discard_state.rb +0 -22
- data/lib/vagrant/action/vm/export.rb +0 -57
- data/lib/vagrant/action/vm/forward_ports.rb +0 -92
- data/lib/vagrant/action/vm/halt.rb +0 -32
- data/lib/vagrant/action/vm/host_name.rb +0 -21
- data/lib/vagrant/action/vm/import.rb +0 -48
- data/lib/vagrant/action/vm/match_mac_address.rb +0 -21
- data/lib/vagrant/action/vm/network.rb +0 -403
- data/lib/vagrant/action/vm/nfs.rb +0 -196
- data/lib/vagrant/action/vm/package.rb +0 -23
- data/lib/vagrant/action/vm/package_vagrantfile.rb +0 -36
- data/lib/vagrant/action/vm/provision.rb +0 -61
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +0 -26
- data/lib/vagrant/action/vm/prune_nfs_exports.rb +0 -20
- data/lib/vagrant/action/vm/resume.rb +0 -20
- data/lib/vagrant/action/vm/sane_defaults.rb +0 -78
- data/lib/vagrant/action/vm/setup_package_files.rb +0 -54
- data/lib/vagrant/action/vm/share_folders.rb +0 -114
- data/lib/vagrant/action/vm/suspend.rb +0 -20
- data/lib/vagrant/command/base.rb +0 -167
- data/lib/vagrant/command/box.rb +0 -58
- data/lib/vagrant/command/box_add.rb +0 -37
- data/lib/vagrant/command/box_list.rb +0 -28
- data/lib/vagrant/command/box_remove.rb +0 -27
- data/lib/vagrant/command/box_repackage.rb +0 -27
- data/lib/vagrant/command/destroy.rb +0 -64
- data/lib/vagrant/command/gem.rb +0 -39
- data/lib/vagrant/command/halt.rb +0 -39
- data/lib/vagrant/command/init.rb +0 -40
- data/lib/vagrant/command/package.rb +0 -75
- data/lib/vagrant/command/provision.rb +0 -40
- data/lib/vagrant/command/reload.rb +0 -39
- data/lib/vagrant/command/resume.rb +0 -33
- data/lib/vagrant/command/ssh.rb +0 -90
- data/lib/vagrant/command/ssh_config.rb +0 -51
- data/lib/vagrant/command/start_mixins.rb +0 -26
- data/lib/vagrant/command/status.rb +0 -36
- data/lib/vagrant/command/suspend.rb +0 -33
- data/lib/vagrant/command/up.rb +0 -40
- data/lib/vagrant/command.rb +0 -24
- data/lib/vagrant/communication/base.rb +0 -56
- data/lib/vagrant/communication/ssh.rb +0 -230
- data/lib/vagrant/communication.rb +0 -7
- data/lib/vagrant/config/base.rb +0 -82
- data/lib/vagrant/config/container.rb +0 -37
- data/lib/vagrant/config/error_recorder.rb +0 -19
- data/lib/vagrant/config/nfs.rb +0 -8
- data/lib/vagrant/config/package.rb +0 -7
- data/lib/vagrant/config/ssh.rb +0 -27
- data/lib/vagrant/config/top.rb +0 -72
- data/lib/vagrant/config/vagrant.rb +0 -14
- data/lib/vagrant/config/vm/provisioner.rb +0 -52
- data/lib/vagrant/config/vm/sub_vm.rb +0 -17
- data/lib/vagrant/config/vm.rb +0 -168
- data/lib/vagrant/data_store.rb +0 -92
- data/lib/vagrant/downloaders/base.rb +0 -25
- data/lib/vagrant/downloaders/file.rb +0 -22
- data/lib/vagrant/downloaders/http.rb +0 -97
- data/lib/vagrant/downloaders.rb +0 -7
- data/lib/vagrant/driver/virtualbox.rb +0 -134
- data/lib/vagrant/driver/virtualbox_4_0.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_1.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_2.rb +0 -606
- data/lib/vagrant/driver/virtualbox_base.rb +0 -326
- data/lib/vagrant/driver.rb +0 -8
- data/lib/vagrant/guest/arch.rb +0 -56
- data/lib/vagrant/guest/base.rb +0 -99
- data/lib/vagrant/guest/debian.rb +0 -64
- data/lib/vagrant/guest/fedora.rb +0 -66
- data/lib/vagrant/guest/freebsd.rb +0 -86
- data/lib/vagrant/guest/gentoo.rb +0 -46
- data/lib/vagrant/guest/linux/config.rb +0 -19
- data/lib/vagrant/guest/linux/error.rb +0 -9
- data/lib/vagrant/guest/linux.rb +0 -118
- data/lib/vagrant/guest/openbsd.rb +0 -20
- data/lib/vagrant/guest/redhat.rb +0 -67
- data/lib/vagrant/guest/solaris.rb +0 -118
- data/lib/vagrant/guest/suse.rb +0 -17
- data/lib/vagrant/guest/ubuntu.rb +0 -23
- data/lib/vagrant/hosts/arch.rb +0 -55
- data/lib/vagrant/hosts/base.rb +0 -66
- data/lib/vagrant/hosts/bsd.rb +0 -97
- data/lib/vagrant/hosts/fedora.rb +0 -47
- data/lib/vagrant/hosts/freebsd.rb +0 -41
- data/lib/vagrant/hosts/gentoo.rb +0 -20
- data/lib/vagrant/hosts/linux.rb +0 -94
- data/lib/vagrant/hosts/opensuse.rb +0 -30
- data/lib/vagrant/hosts/windows.rb +0 -16
- data/lib/vagrant/hosts.rb +0 -37
- data/lib/vagrant/provisioners/base.rb +0 -44
- data/lib/vagrant/provisioners/chef.rb +0 -168
- data/lib/vagrant/provisioners/chef_client.rb +0 -132
- data/lib/vagrant/provisioners/chef_solo.rb +0 -234
- data/lib/vagrant/provisioners/puppet.rb +0 -176
- data/lib/vagrant/provisioners/puppet_server.rb +0 -78
- data/lib/vagrant/provisioners/shell.rb +0 -103
- data/lib/vagrant/provisioners.rb +0 -12
- data/lib/vagrant/ssh.rb +0 -126
- data/lib/vagrant/test_helpers.rb +0 -154
- data/lib/vagrant/vm.rb +0 -195
- data/templates/guests/arch/network_dhcp.erb +0 -7
- data/templates/guests/arch/network_static.erb +0 -7
- data/templates/guests/fedora/network_dhcp.erb +0 -6
- data/templates/guests/fedora/network_static.erb +0 -13
- data/templates/nfs/exports.erb +0 -5
- data/templates/nfs/exports_freebsd.erb +0 -5
- data/test/acceptance/base.rb +0 -48
- data/test/acceptance/box_test.rb +0 -99
- data/test/acceptance/destroy_test.rb +0 -37
- data/test/acceptance/halt_test.rb +0 -72
- data/test/acceptance/init_test.rb +0 -33
- data/test/acceptance/networking/host_only_test.rb +0 -37
- data/test/acceptance/networking/port_forward_test.rb +0 -125
- data/test/acceptance/package_test.rb +0 -46
- data/test/acceptance/provisioning/basic_test.rb +0 -61
- data/test/acceptance/provisioning/chef_solo_test.rb +0 -37
- data/test/acceptance/provisioning/shell_test.rb +0 -53
- data/test/acceptance/resume_test.rb +0 -17
- data/test/acceptance/shared_folders_test.rb +0 -84
- data/test/acceptance/skeletons/chef_solo_basic/README.md +0 -3
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +0 -5
- data/test/acceptance/skeletons/chef_solo_json/README.md +0 -3
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +0 -6
- data/test/acceptance/skeletons/provisioner_multi/README.md +0 -3
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +0 -5
- data/test/acceptance/ssh_test.rb +0 -46
- data/test/acceptance/support/config.rb +0 -42
- data/test/acceptance/support/isolated_environment.rb +0 -117
- data/test/acceptance/support/matchers/have_color.rb +0 -9
- data/test/acceptance/support/matchers/match_output.rb +0 -14
- data/test/acceptance/support/matchers/succeed.rb +0 -14
- data/test/acceptance/support/network_tests.rb +0 -29
- data/test/acceptance/support/output.rb +0 -95
- data/test/acceptance/support/shared/base_context.rb +0 -72
- data/test/acceptance/support/shared/command_examples.rb +0 -33
- data/test/acceptance/support/virtualbox.rb +0 -36
- data/test/acceptance/suspend_test.rb +0 -56
- data/test/acceptance/up_basic_test.rb +0 -33
- data/test/acceptance/up_with_box_url.rb +0 -40
- data/test/acceptance/vagrant_test.rb +0 -47
- data/test/acceptance/version_test.rb +0 -15
- data/test/buildbot/README.md +0 -72
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +0 -24
- data/test/buildbot/buildbot_config/config/master.py +0 -24
- data/test/buildbot/buildbot_config/config/slave.py +0 -22
- data/test/buildbot/buildbot_config/master/__init__.py +0 -6
- data/test/buildbot/buildbot_config/master/builders.py +0 -78
- data/test/buildbot/buildbot_config/master/buildsteps.py +0 -100
- data/test/buildbot/buildbot_config/master/change_sources.py +0 -8
- data/test/buildbot/buildbot_config/master/schedulers.py +0 -32
- data/test/buildbot/buildbot_config/master/slaves.py +0 -60
- data/test/buildbot/buildbot_config/master/status.py +0 -52
- data/test/buildbot/master/Makefile.sample +0 -28
- data/test/buildbot/master/buildbot.tac +0 -36
- data/test/buildbot/master/master.cfg +0 -67
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +0 -545
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +0 -10
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +0 -356
- data/test/buildbot/master/public_html/static/css/prettify.css +0 -97
- data/test/buildbot/master/public_html/static/css/syntax.css +0 -60
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +0 -205
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +0 -80
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +0 -4
- data/test/buildbot/master/templates/authfail.html +0 -9
- data/test/buildbot/master/templates/build.html +0 -205
- data/test/buildbot/master/templates/builder.html +0 -118
- data/test/buildbot/master/templates/builders.html +0 -33
- data/test/buildbot/master/templates/buildslave.html +0 -72
- data/test/buildbot/master/templates/buildslaves.html +0 -70
- data/test/buildbot/master/templates/change.html +0 -15
- data/test/buildbot/master/templates/layouts/base.html +0 -58
- data/test/buildbot/master/templates/macros/box.html +0 -37
- data/test/buildbot/master/templates/macros/build_line.html +0 -50
- data/test/buildbot/master/templates/macros/change.html +0 -81
- data/test/buildbot/master/templates/macros/forms.html +0 -300
- data/test/buildbot/master/templates/root.html +0 -42
- data/test/buildbot/master/templates/waterfall.html +0 -53
- data/test/buildbot/requirements.txt +0 -4
- data/test/buildbot/scripts/deploy.sh +0 -38
- data/test/buildbot/scripts/setup.sh +0 -107
- data/test/buildbot/slave/buildbot.tac +0 -43
- data/test/buildbot/slave/info/admin +0 -1
- data/test/buildbot/slave/info/host +0 -1
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +0 -41
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +0 -7
- data/test/support/isolated_environment.rb +0 -46
- data/test/support/tempdir.rb +0 -34
- data/test/unit/base.rb +0 -21
- data/test/unit/support/isolated_environment.rb +0 -47
- data/test/unit/support/shared/base_context.rb +0 -30
- data/test/unit/vagrant/action/builder_test.rb +0 -156
- data/test/unit/vagrant/action/environment_test.rb +0 -16
- data/test/unit/vagrant/action/runner_test.rb +0 -65
- data/test/unit/vagrant/action/warden_test.rb +0 -92
- data/test/unit/vagrant/box_collection_test.rb +0 -56
- data/test/unit/vagrant/box_test.rb +0 -34
- data/test/unit/vagrant/command/base_test.rb +0 -150
- data/test/unit/vagrant/config/base_test.rb +0 -48
- data/test/unit/vagrant/config/loader_test.rb +0 -79
- data/test/unit/vagrant/config/ssh_test.rb +0 -17
- data/test/unit/vagrant/config/top_test.rb +0 -69
- data/test/unit/vagrant/config/vm_test.rb +0 -71
- data/test/unit/vagrant/config_test.rb +0 -27
- data/test/unit/vagrant/data_store_test.rb +0 -79
- data/test/unit/vagrant/downloaders/base_test.rb +0 -18
- data/test/unit/vagrant/downloaders/file_test.rb +0 -75
- data/test/unit/vagrant/downloaders/http_test.rb +0 -19
- data/test/unit/vagrant/environment_test.rb +0 -220
- data/test/unit/vagrant/hosts_test.rb +0 -36
- data/test/unit/vagrant/registry_test.rb +0 -74
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +0 -16
- data/test/unit/vagrant/util/file_checksum_test.rb +0 -23
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +0 -38
- data/test/unit/vagrant/util/is_port_open_test.rb +0 -53
- data/test/unit/vagrant/util/line_endings_helper_test.rb +0 -16
- data/test/unit/vagrant/util/network_ip_test.rb +0 -17
- data/test/unit/vagrant/util/retryable_test.rb +0 -106
- data/test/unit/vagrant_test.rb +0 -27
- data/test/unit_legacy/locales/en.yml +0 -8
- data/test/unit_legacy/test_helper.rb +0 -32
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +0 -18
- data/test/unit_legacy/vagrant/action/box/download_test.rb +0 -125
- data/test/unit_legacy/vagrant/action/box/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +0 -30
- data/test/unit_legacy/vagrant/action/env/set_test.rb +0 -24
- data/test/unit_legacy/vagrant/action/general/package_test.rb +0 -268
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +0 -31
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +0 -9
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +0 -52
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +0 -22
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +0 -37
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +0 -49
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +0 -45
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +0 -107
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +0 -77
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +0 -197
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +0 -79
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +0 -36
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +0 -38
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +0 -286
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +0 -26
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +0 -260
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +0 -46
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +0 -65
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +0 -56
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +0 -35
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +0 -144
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +0 -35
- data/test/unit_legacy/vagrant/action_test.rb +0 -89
- data/test/unit_legacy/vagrant/box_collection_test.rb +0 -45
- data/test/unit_legacy/vagrant/box_test.rb +0 -74
- data/test/unit_legacy/vagrant/cli_test.rb +0 -35
- data/test/unit_legacy/vagrant/command/base_test.rb +0 -23
- data/test/unit_legacy/vagrant/command/group_base_test.rb +0 -15
- data/test/unit_legacy/vagrant/command/helpers_test.rb +0 -88
- data/test/unit_legacy/vagrant/command/init_test.rb +0 -10
- data/test/unit_legacy/vagrant/command/package_test.rb +0 -27
- data/test/unit_legacy/vagrant/config/base_test.rb +0 -52
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +0 -18
- data/test/unit_legacy/vagrant/config/ssh_test.rb +0 -12
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +0 -35
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +0 -92
- data/test/unit_legacy/vagrant/config/vm_test.rb +0 -47
- data/test/unit_legacy/vagrant/config_test.rb +0 -148
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +0 -93
- data/test/unit_legacy/vagrant/environment_test.rb +0 -539
- data/test/unit_legacy/vagrant/errors_test.rb +0 -42
- data/test/unit_legacy/vagrant/hosts/base_test.rb +0 -46
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +0 -53
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +0 -54
- data/test/unit_legacy/vagrant/plugin_test.rb +0 -9
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +0 -63
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +0 -190
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +0 -115
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +0 -209
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +0 -68
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +0 -182
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +0 -79
- data/test/unit_legacy/vagrant/ssh/session_test.rb +0 -40
- data/test/unit_legacy/vagrant/ssh_test.rb +0 -304
- data/test/unit_legacy/vagrant/systems/base_test.rb +0 -18
- data/test/unit_legacy/vagrant/systems/linux_test.rb +0 -104
- data/test/unit_legacy/vagrant/util/busy_test.rb +0 -106
- data/test/unit_legacy/vagrant/util/counter_test.rb +0 -29
- data/test/unit_legacy/vagrant/util/platform_test.rb +0 -18
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +0 -43
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +0 -145
- data/test/unit_legacy/vagrant/vm_test.rb +0 -300
- /data/{test/buildbot/buildbot_config/__init__.py → .gitmodules} +0 -0
data/lib/vagrant/environment.rb
CHANGED
@@ -1,45 +1,79 @@
|
|
1
|
-
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
2
4
|
require 'fileutils'
|
5
|
+
require 'json'
|
6
|
+
require 'pathname'
|
7
|
+
require 'set'
|
8
|
+
require 'thread'
|
3
9
|
|
4
10
|
require 'log4r'
|
5
|
-
require 'rubygems' # This is needed for plugin loading below.
|
6
11
|
|
7
12
|
require 'vagrant/util/file_mode'
|
8
13
|
require 'vagrant/util/platform'
|
14
|
+
require 'vagrant/util/hash_with_indifferent_access'
|
15
|
+
require "vagrant/util/silence_warnings"
|
16
|
+
require "vagrant/vagrantfile"
|
17
|
+
require "vagrant/version"
|
9
18
|
|
10
19
|
module Vagrant
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
20
|
+
# A "Vagrant environment" represents a configuration of how Vagrant
|
21
|
+
# should behave: data directories, working directory, UI output,
|
22
|
+
# etc. In day-to-day usage, every `vagrant` invocation typically
|
23
|
+
# leads to a single Vagrant environment.
|
14
24
|
class Environment
|
15
|
-
|
16
|
-
|
17
|
-
|
25
|
+
# This is the current version that this version of Vagrant is
|
26
|
+
# compatible with in the home directory.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
CURRENT_SETUP_VERSION = "1.5"
|
30
|
+
|
31
|
+
DEFAULT_LOCAL_DATA = ".vagrant"
|
18
32
|
|
19
33
|
# The `cwd` that this environment represents
|
20
34
|
attr_reader :cwd
|
21
35
|
|
36
|
+
# The persistent data directory where global data can be stored. It
|
37
|
+
# is up to the creator of the data in this directory to properly
|
38
|
+
# remove it when it is no longer needed.
|
39
|
+
#
|
40
|
+
# @return [Pathname]
|
41
|
+
attr_reader :data_dir
|
42
|
+
|
22
43
|
# The valid name for a Vagrantfile for this environment.
|
23
44
|
attr_reader :vagrantfile_name
|
24
45
|
|
25
46
|
# The {UI} object to communicate with the outside world.
|
26
47
|
attr_reader :ui
|
27
48
|
|
49
|
+
# This is the UI class to use when creating new UIs.
|
50
|
+
attr_reader :ui_class
|
51
|
+
|
28
52
|
# The directory to the "home" folder that Vagrant will use to store
|
29
53
|
# global state.
|
30
54
|
attr_reader :home_path
|
31
55
|
|
56
|
+
# The directory to the directory where local, environment-specific
|
57
|
+
# data is stored.
|
58
|
+
attr_reader :local_data_path
|
59
|
+
|
32
60
|
# The directory where temporary files for Vagrant go.
|
33
61
|
attr_reader :tmp_path
|
34
62
|
|
63
|
+
# File where command line aliases go.
|
64
|
+
attr_reader :aliases_path
|
65
|
+
|
35
66
|
# The directory where boxes are stored.
|
36
67
|
attr_reader :boxes_path
|
37
68
|
|
38
69
|
# The path where the plugins are stored (gems)
|
39
70
|
attr_reader :gems_path
|
40
71
|
|
41
|
-
# The path to the default private
|
42
|
-
attr_reader :
|
72
|
+
# The path to the default private keys directory
|
73
|
+
attr_reader :default_private_keys_directory
|
74
|
+
|
75
|
+
# The paths for each of the default private keys
|
76
|
+
attr_reader :default_private_key_paths
|
43
77
|
|
44
78
|
# Initializes a new environment with the given options. The options
|
45
79
|
# is a hash where the main available key is `cwd`, which defines where
|
@@ -48,114 +82,230 @@ module Vagrant
|
|
48
82
|
# to the `Dir.pwd` (which is the cwd of the executing process).
|
49
83
|
def initialize(opts=nil)
|
50
84
|
opts = {
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
85
|
+
cwd: nil,
|
86
|
+
home_path: nil,
|
87
|
+
local_data_path: nil,
|
88
|
+
ui_class: nil,
|
89
|
+
ui_opts: nil,
|
90
|
+
vagrantfile_name: nil,
|
56
91
|
}.merge(opts || {})
|
57
92
|
|
58
93
|
# Set the default working directory to look for the vagrantfile
|
59
|
-
opts[:cwd] ||= ENV["VAGRANT_CWD"] if ENV.
|
94
|
+
opts[:cwd] ||= ENV["VAGRANT_CWD"] if ENV.key?("VAGRANT_CWD")
|
60
95
|
opts[:cwd] ||= Dir.pwd
|
61
96
|
opts[:cwd] = Pathname.new(opts[:cwd])
|
62
|
-
|
97
|
+
if !opts[:cwd].directory?
|
98
|
+
raise Errors::EnvironmentNonExistentCWD, cwd: opts[:cwd].to_s
|
99
|
+
end
|
100
|
+
opts[:cwd] = opts[:cwd].expand_path
|
101
|
+
|
102
|
+
# Set the default ui class
|
103
|
+
opts[:ui_class] ||= UI::Silent
|
63
104
|
|
64
105
|
# Set the Vagrantfile name up. We append "Vagrantfile" and "vagrantfile" so that
|
65
106
|
# those continue to work as well, but anything custom will take precedence.
|
66
|
-
opts[:vagrantfile_name] ||= []
|
67
|
-
|
68
|
-
opts[:vagrantfile_name]
|
107
|
+
opts[:vagrantfile_name] ||= ENV["VAGRANT_VAGRANTFILE"] if \
|
108
|
+
ENV.key?("VAGRANT_VAGRANTFILE")
|
109
|
+
opts[:vagrantfile_name] = [opts[:vagrantfile_name]] if \
|
110
|
+
opts[:vagrantfile_name] && !opts[:vagrantfile_name].is_a?(Array)
|
69
111
|
|
70
112
|
# Set instance variables for all the configuration parameters.
|
71
|
-
@cwd
|
113
|
+
@cwd = opts[:cwd]
|
114
|
+
@home_path = opts[:home_path]
|
72
115
|
@vagrantfile_name = opts[:vagrantfile_name]
|
73
|
-
@
|
74
|
-
@
|
116
|
+
@ui = opts.fetch(:ui, opts[:ui_class].new)
|
117
|
+
@ui_class = opts[:ui_class]
|
118
|
+
|
119
|
+
if @ui.nil?
|
120
|
+
if opts[:ui_opts].nil?
|
121
|
+
@ui = opts[:ui_class].new
|
122
|
+
else
|
123
|
+
@ui = opts[:ui_class].new(*opts[:ui_opts])
|
124
|
+
end
|
125
|
+
end
|
75
126
|
|
76
|
-
|
77
|
-
|
127
|
+
# This is the batch lock, that enforces that only one {BatchAction}
|
128
|
+
# runs at a time from {#batch}.
|
129
|
+
@batch_lock = Mutex.new
|
78
130
|
|
79
|
-
@
|
80
|
-
@lock_acquired = false
|
131
|
+
@locks = {}
|
81
132
|
|
82
133
|
@logger = Log4r::Logger.new("vagrant::environment")
|
83
134
|
@logger.info("Environment initialized (#{self})")
|
84
135
|
@logger.info(" - cwd: #{cwd}")
|
85
136
|
|
86
137
|
# Setup the home directory
|
87
|
-
|
88
|
-
@
|
138
|
+
@home_path ||= Vagrant.user_data_path
|
139
|
+
@home_path = Util::Platform.fs_real_path(@home_path)
|
89
140
|
@boxes_path = @home_path.join("boxes")
|
90
|
-
@
|
141
|
+
@data_dir = @home_path.join("data")
|
142
|
+
@gems_path = Vagrant::Bundler.instance.plugin_gem_path
|
143
|
+
@tmp_path = @home_path.join("tmp")
|
144
|
+
@machine_index_dir = @data_dir.join("machine-index")
|
145
|
+
|
146
|
+
@aliases_path = Pathname.new(ENV["VAGRANT_ALIAS_FILE"]).expand_path if ENV.key?("VAGRANT_ALIAS_FILE")
|
147
|
+
@aliases_path ||= @home_path.join("aliases")
|
148
|
+
|
149
|
+
# Prepare the directories
|
150
|
+
setup_home_path
|
151
|
+
|
152
|
+
# Setup the local data directory. If a configuration path is given,
|
153
|
+
# it is expanded relative to the root path. Otherwise, we use the
|
154
|
+
# default (which is also expanded relative to the root path).
|
155
|
+
if !root_path.nil?
|
156
|
+
if !ENV["VAGRANT_DOTFILE_PATH"].to_s.empty? && !opts[:child]
|
157
|
+
opts[:local_data_path] ||= Pathname.new(File.expand_path(ENV["VAGRANT_DOTFILE_PATH"], root_path))
|
158
|
+
else
|
159
|
+
opts[:local_data_path] ||= root_path.join(DEFAULT_LOCAL_DATA)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
if opts[:local_data_path]
|
163
|
+
@local_data_path = Pathname.new(File.expand_path(opts[:local_data_path], @cwd))
|
164
|
+
end
|
165
|
+
|
166
|
+
@logger.debug("Effective local data path: #{@local_data_path}")
|
167
|
+
|
168
|
+
# If we have a root path, load the ".vagrantplugins" file.
|
169
|
+
if root_path
|
170
|
+
plugins_file = root_path.join(".vagrantplugins")
|
171
|
+
if plugins_file.file?
|
172
|
+
@logger.info("Loading plugins file: #{plugins_file}")
|
173
|
+
load plugins_file
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
setup_local_data_path
|
91
178
|
|
92
179
|
# Setup the default private key
|
93
180
|
@default_private_key_path = @home_path.join("insecure_private_key")
|
94
|
-
|
181
|
+
@default_private_keys_directory = @home_path.join("insecure_private_keys")
|
182
|
+
if !@default_private_keys_directory.directory?
|
183
|
+
@default_private_keys_directory.mkdir
|
184
|
+
end
|
185
|
+
@default_private_key_paths = []
|
186
|
+
copy_insecure_private_keys
|
95
187
|
|
96
|
-
#
|
97
|
-
|
98
|
-
|
188
|
+
# Initialize localized plugins
|
189
|
+
plugins = Vagrant::Plugin::Manager.instance.localize!(self)
|
190
|
+
# Load any environment local plugins
|
191
|
+
Vagrant::Plugin::Manager.instance.load_plugins(plugins)
|
99
192
|
|
100
|
-
|
101
|
-
|
102
|
-
|
193
|
+
# Initialize globalize plugins
|
194
|
+
plugins = Vagrant::Plugin::Manager.instance.globalize!
|
195
|
+
# Load any global plugins
|
196
|
+
Vagrant::Plugin::Manager.instance.load_plugins(plugins)
|
103
197
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
198
|
+
plugins = process_configured_plugins
|
199
|
+
|
200
|
+
# Call the hooks that does not require configurations to be loaded
|
201
|
+
# by using a "clean" action runner
|
202
|
+
hook(:environment_plugins_loaded, runner: Action::PrimaryRunner.new(env: self))
|
203
|
+
|
204
|
+
# Call the environment load hooks
|
205
|
+
hook(:environment_load, runner: Action::PrimaryRunner.new(env: self))
|
111
206
|
end
|
112
207
|
|
113
|
-
#
|
114
|
-
#
|
115
|
-
|
116
|
-
|
117
|
-
@
|
208
|
+
# The path to the default private key
|
209
|
+
# NOTE: deprecated, used default_private_keys_directory instead
|
210
|
+
def default_private_key_path
|
211
|
+
# TODO(spox): Add deprecation warning
|
212
|
+
@default_private_key_path
|
118
213
|
end
|
119
214
|
|
120
|
-
#
|
215
|
+
# Return a human-friendly string for pretty printed or inspected
|
216
|
+
# instances.
|
121
217
|
#
|
122
|
-
# @return [
|
123
|
-
def
|
124
|
-
|
125
|
-
@vms ||= load_vms!
|
218
|
+
# @return [String]
|
219
|
+
def inspect
|
220
|
+
"#<#{self.class}: #{@cwd}>".encode('external')
|
126
221
|
end
|
127
222
|
|
128
|
-
#
|
129
|
-
# that they were defined.
|
223
|
+
# Action runner for executing actions in the context of this environment.
|
130
224
|
#
|
131
|
-
# @return [
|
132
|
-
def
|
133
|
-
|
134
|
-
|
225
|
+
# @return [Action::Runner]
|
226
|
+
def action_runner
|
227
|
+
@action_runner ||= Action::PrimaryRunner.new do
|
228
|
+
{
|
229
|
+
action_runner: action_runner,
|
230
|
+
box_collection: boxes,
|
231
|
+
hook: method(:hook),
|
232
|
+
host: host,
|
233
|
+
machine_index: machine_index,
|
234
|
+
gems_path: gems_path,
|
235
|
+
home_path: home_path,
|
236
|
+
root_path: root_path,
|
237
|
+
tmp_path: tmp_path,
|
238
|
+
ui: @ui,
|
239
|
+
env: self
|
240
|
+
}
|
241
|
+
end
|
135
242
|
end
|
136
243
|
|
137
|
-
# Returns
|
138
|
-
#
|
139
|
-
#
|
244
|
+
# Returns a list of machines that this environment is currently
|
245
|
+
# managing that physically have been created.
|
246
|
+
#
|
247
|
+
# An "active" machine is a machine that Vagrant manages that has
|
248
|
+
# been created. The machine itself may be in any state such as running,
|
249
|
+
# suspended, etc. but if a machine is "active" then it exists.
|
140
250
|
#
|
141
|
-
#
|
142
|
-
|
143
|
-
|
251
|
+
# Note that the machines in this array may no longer be present in
|
252
|
+
# the Vagrantfile of this environment. In this case the machine can
|
253
|
+
# be considered an "orphan." Determining which machines are orphan
|
254
|
+
# and which aren't is not currently a supported feature, but will
|
255
|
+
# be in a future version.
|
256
|
+
#
|
257
|
+
# @return [Array<String, Symbol>]
|
258
|
+
def active_machines
|
259
|
+
# We have no active machines if we have no data path
|
260
|
+
return [] if !@local_data_path
|
261
|
+
|
262
|
+
machine_folder = @local_data_path.join("machines")
|
263
|
+
|
264
|
+
# If the machine folder is not a directory then we just return
|
265
|
+
# an empty array since no active machines exist.
|
266
|
+
return [] if !machine_folder.directory?
|
267
|
+
|
268
|
+
# Traverse the machines folder accumulate a result
|
269
|
+
result = []
|
270
|
+
|
271
|
+
machine_folder.children(true).each do |name_folder|
|
272
|
+
# If this isn't a directory then it isn't a machine
|
273
|
+
next if !name_folder.directory?
|
144
274
|
|
145
|
-
|
146
|
-
|
275
|
+
name = name_folder.basename.to_s.to_sym
|
276
|
+
name_folder.children(true).each do |provider_folder|
|
277
|
+
# If this isn't a directory then it isn't a provider
|
278
|
+
next if !provider_folder.directory?
|
279
|
+
|
280
|
+
# If this machine doesn't have an ID, then ignore
|
281
|
+
next if !provider_folder.join("id").file?
|
282
|
+
|
283
|
+
provider = provider_folder.basename.to_s.to_sym
|
284
|
+
result << [name, provider]
|
285
|
+
end
|
147
286
|
end
|
148
287
|
|
149
|
-
|
288
|
+
# Return the results
|
289
|
+
result
|
150
290
|
end
|
151
291
|
|
152
|
-
#
|
153
|
-
#
|
154
|
-
# environments.
|
292
|
+
# This creates a new batch action, yielding it, and then running it
|
293
|
+
# once the block is called.
|
155
294
|
#
|
156
|
-
#
|
157
|
-
|
158
|
-
|
295
|
+
# This handles the case where batch actions are disabled by the
|
296
|
+
# VAGRANT_NO_PARALLEL environmental variable.
|
297
|
+
def batch(parallel=true)
|
298
|
+
parallel = false if ENV["VAGRANT_NO_PARALLEL"]
|
299
|
+
|
300
|
+
@batch_lock.synchronize do
|
301
|
+
BatchAction.new(parallel).tap do |b|
|
302
|
+
# Yield it so that the caller can setup actions
|
303
|
+
yield b
|
304
|
+
|
305
|
+
# And run it!
|
306
|
+
b.run
|
307
|
+
end
|
308
|
+
end
|
159
309
|
end
|
160
310
|
|
161
311
|
# Makes a call to the CLI with the given arguments as if they
|
@@ -167,293 +317,543 @@ module Vagrant
|
|
167
317
|
CLI.new(args.flatten, self).execute
|
168
318
|
end
|
169
319
|
|
170
|
-
#
|
320
|
+
# This returns the provider name for the default provider for this
|
321
|
+
# environment.
|
171
322
|
#
|
172
|
-
# @
|
173
|
-
|
174
|
-
|
323
|
+
# @param check_usable [Boolean] (true) whether to filter for `.usable?` providers
|
324
|
+
# @param exclude [Array<Symbol>] ([]) list of provider names to exclude from
|
325
|
+
# consideration
|
326
|
+
# @param force_default [Boolean] (true) whether to prefer the value of
|
327
|
+
# VAGRANT_DEFAULT_PROVIDER over other strategies if it is set
|
328
|
+
# @param machine [Symbol] (nil) a machine name to scope this lookup
|
329
|
+
# @return [Symbol] Name of the default provider.
|
330
|
+
def default_provider(**opts)
|
331
|
+
opts[:exclude] = Set.new(opts[:exclude]) if opts[:exclude]
|
332
|
+
opts[:force_default] = true if !opts.key?(:force_default)
|
333
|
+
opts[:check_usable] = true if !opts.key?(:check_usable)
|
334
|
+
|
335
|
+
# Implement the algorithm from
|
336
|
+
# https://www.vagrantup.com/docs/providers/basic_usage.html#default-provider
|
337
|
+
# with additional steps 2.5 and 3.5 from
|
338
|
+
# https://bugzilla.redhat.com/show_bug.cgi?id=1444492
|
339
|
+
# to allow system-configured provider priorities.
|
340
|
+
#
|
341
|
+
# 1. The --provider flag on a vagrant up is chosen above all else, if it is
|
342
|
+
# present.
|
343
|
+
#
|
344
|
+
# (Step 1 is done by the caller; this method is only called if --provider
|
345
|
+
# wasn't given.)
|
346
|
+
#
|
347
|
+
# 2. If the VAGRANT_DEFAULT_PROVIDER environmental variable is set, it
|
348
|
+
# takes next priority and will be the provider chosen.
|
349
|
+
|
350
|
+
default = ENV["VAGRANT_DEFAULT_PROVIDER"].to_s
|
351
|
+
if default.empty?
|
352
|
+
default = nil
|
353
|
+
else
|
354
|
+
default = default.to_sym
|
355
|
+
@logger.debug("Default provider: `#{default}`")
|
356
|
+
end
|
357
|
+
|
358
|
+
# If we're forcing the default, just short-circuit and return
|
359
|
+
# that (the default behavior)
|
360
|
+
if default && opts[:force_default]
|
361
|
+
@logger.debug("Using forced default provider: `#{default}`")
|
362
|
+
return default
|
363
|
+
end
|
175
364
|
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
365
|
+
# Determine the config to use to look for provider definitions. By
|
366
|
+
# default it is the global but if we're targeting a specific machine,
|
367
|
+
# then look there.
|
368
|
+
root_config = vagrantfile.config
|
369
|
+
if opts[:machine]
|
370
|
+
machine_info = vagrantfile.machine_config(opts[:machine], nil, nil, nil)
|
371
|
+
root_config = machine_info[:config]
|
372
|
+
end
|
183
373
|
|
184
|
-
#
|
185
|
-
|
374
|
+
# Get the list of providers within our configuration, in order.
|
375
|
+
config = root_config.vm.__providers
|
186
376
|
|
187
|
-
|
188
|
-
|
377
|
+
# Get the list of usable providers with their internally-declared
|
378
|
+
# priorities.
|
379
|
+
usable = []
|
380
|
+
Vagrant.plugin("2").manager.providers.each do |key, data|
|
381
|
+
impl = data[0]
|
382
|
+
popts = data[1]
|
189
383
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
:
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
384
|
+
# Skip excluded providers
|
385
|
+
next if opts[:exclude] && opts[:exclude].include?(key)
|
386
|
+
|
387
|
+
# Skip providers that can't be defaulted, unless they're in our
|
388
|
+
# config, in which case someone made our decision for us.
|
389
|
+
if !config.include?(key)
|
390
|
+
next if popts.key?(:defaultable) && !popts[:defaultable]
|
391
|
+
end
|
392
|
+
|
393
|
+
# Skip providers that aren't usable.
|
394
|
+
next if opts[:check_usable] && !impl.usable?(false)
|
395
|
+
|
396
|
+
# Each provider sets its own priority, defaulting to 5 so we can trust
|
397
|
+
# it's always set.
|
398
|
+
usable << [popts[:priority], key]
|
399
|
+
end
|
400
|
+
@logger.debug("Initial usable provider list: #{usable}")
|
401
|
+
|
402
|
+
# Sort the usable providers by priority. Higher numbers are higher
|
403
|
+
# priority, otherwise alpha sort.
|
404
|
+
usable = usable.sort {|a, b| a[0] == b[0] ? a[1] <=> b[1] : b[0] <=> a[0]}
|
405
|
+
.map {|prio, key| key}
|
406
|
+
@logger.debug("Priority sorted usable provider list: #{usable}")
|
407
|
+
|
408
|
+
# If we're not forcing the default, but it's usable and hasn't been
|
409
|
+
# otherwise excluded, return it now.
|
410
|
+
if usable.include?(default)
|
411
|
+
@logger.debug("Using default provider `#{default}` as it was found in usable list.")
|
412
|
+
return default
|
204
413
|
end
|
414
|
+
|
415
|
+
# 2.5. Vagrant will go through all of the config.vm.provider calls in the
|
416
|
+
# Vagrantfile and try each in order. It will choose the first
|
417
|
+
# provider that is usable and listed in VAGRANT_PREFERRED_PROVIDERS.
|
418
|
+
|
419
|
+
preferred = ENV.fetch('VAGRANT_PREFERRED_PROVIDERS', '')
|
420
|
+
.split(',')
|
421
|
+
.map {|s| s.strip}
|
422
|
+
.select {|s| !s.empty?}
|
423
|
+
.map {|s| s.to_sym}
|
424
|
+
@logger.debug("Preferred provider list: #{preferred}")
|
425
|
+
|
426
|
+
config.each do |key|
|
427
|
+
if usable.include?(key) && preferred.include?(key)
|
428
|
+
@logger.debug("Using preferred provider `#{key}` detected in configuration and usable.")
|
429
|
+
return key
|
430
|
+
end
|
431
|
+
end
|
432
|
+
|
433
|
+
# 3. Vagrant will go through all of the config.vm.provider calls in the
|
434
|
+
# Vagrantfile and try each in order. It will choose the first provider
|
435
|
+
# that is usable. For example, if you configure Hyper-V, it will never
|
436
|
+
# be chosen on Mac this way. It must be both configured and usable.
|
437
|
+
|
438
|
+
config.each do |key|
|
439
|
+
if usable.include?(key)
|
440
|
+
@logger.debug("Using provider `#{key}` detected in configuration and usable.")
|
441
|
+
return key
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
445
|
+
# 3.5. Vagrant will go through VAGRANT_PREFERRED_PROVIDERS and find the
|
446
|
+
# first plugin that reports it is usable.
|
447
|
+
|
448
|
+
preferred.each do |key|
|
449
|
+
if usable.include?(key)
|
450
|
+
@logger.debug("Using preferred provider `#{key}` found in usable list.")
|
451
|
+
return key
|
452
|
+
end
|
453
|
+
end
|
454
|
+
|
455
|
+
# 4. Vagrant will go through all installed provider plugins (including the
|
456
|
+
# ones that come with Vagrant), and find the first plugin that reports
|
457
|
+
# it is usable. There is a priority system here: systems that are known
|
458
|
+
# better have a higher priority than systems that are worse. For
|
459
|
+
# example, if you have the VMware provider installed, it will always
|
460
|
+
# take priority over VirtualBox.
|
461
|
+
|
462
|
+
if !usable.empty?
|
463
|
+
@logger.debug("Using provider `#{usable[0]}` as it is the highest priority in the usable list.")
|
464
|
+
return usable[0]
|
465
|
+
end
|
466
|
+
|
467
|
+
# 5. If Vagrant still has not found any usable providers, it will error.
|
468
|
+
|
469
|
+
# No providers available is a critical error for Vagrant.
|
470
|
+
raise Errors::NoDefaultProvider
|
205
471
|
end
|
206
472
|
|
207
|
-
#
|
473
|
+
# Returns whether or not we know how to install the provider with
|
474
|
+
# the given name.
|
208
475
|
#
|
209
|
-
# @return [
|
210
|
-
def
|
211
|
-
|
212
|
-
# we may want to create an isolated registry that inherits from this
|
213
|
-
# global one, but for now there isn't a use case that calls for it.
|
214
|
-
Vagrant.actions
|
476
|
+
# @return [Boolean]
|
477
|
+
def can_install_provider?(name)
|
478
|
+
host.capability?(provider_install_key(name))
|
215
479
|
end
|
216
480
|
|
217
|
-
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
481
|
+
# Installs the provider with the given name.
|
482
|
+
#
|
483
|
+
# This will raise an exception if we don't know how to install the
|
484
|
+
# provider with the given name. You should guard this call with
|
485
|
+
# `can_install_provider?` for added safety.
|
222
486
|
#
|
223
|
-
#
|
224
|
-
|
225
|
-
|
487
|
+
# An exception will be raised if there are any failures installing
|
488
|
+
# the provider.
|
489
|
+
def install_provider(name)
|
490
|
+
host.capability(provider_install_key(name))
|
226
491
|
end
|
227
492
|
|
228
|
-
#
|
229
|
-
# store. This file is always at the root path as the file "~/.vagrant"
|
230
|
-
# and contains a JSON dump of a hash. See {DataStore} for more
|
231
|
-
# information.
|
493
|
+
# Returns the collection of boxes for the environment.
|
232
494
|
#
|
233
|
-
# @return [
|
234
|
-
def
|
235
|
-
@
|
495
|
+
# @return [BoxCollection]
|
496
|
+
def boxes
|
497
|
+
@_boxes ||= BoxCollection.new(
|
498
|
+
boxes_path,
|
499
|
+
hook: method(:hook),
|
500
|
+
temp_dir_root: tmp_path)
|
236
501
|
end
|
237
502
|
|
238
|
-
#
|
239
|
-
#
|
240
|
-
# this environment.
|
503
|
+
# Returns the {Config::Loader} that can be used to load Vagrantfiles
|
504
|
+
# given the settings of this environment.
|
241
505
|
#
|
242
|
-
# @return [
|
243
|
-
def
|
244
|
-
return @
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
end
|
252
|
-
|
253
|
-
return path if found
|
254
|
-
return nil if path.root? || !File.exist?(path)
|
255
|
-
root_finder.call(path.parent)
|
506
|
+
# @return [Config::Loader]
|
507
|
+
def config_loader
|
508
|
+
return @config_loader if @config_loader
|
509
|
+
|
510
|
+
home_vagrantfile = nil
|
511
|
+
root_vagrantfile = nil
|
512
|
+
home_vagrantfile = find_vagrantfile(home_path) if home_path
|
513
|
+
if root_path
|
514
|
+
root_vagrantfile = find_vagrantfile(root_path, @vagrantfile_name)
|
256
515
|
end
|
257
516
|
|
258
|
-
@
|
517
|
+
@config_loader = Config::Loader.new(
|
518
|
+
Config::VERSIONS, Config::VERSIONS_ORDER)
|
519
|
+
@config_loader.set(:home, home_vagrantfile) if home_vagrantfile
|
520
|
+
@config_loader.set(:root, root_vagrantfile) if root_vagrantfile
|
521
|
+
@config_loader
|
259
522
|
end
|
260
523
|
|
261
|
-
#
|
262
|
-
#
|
263
|
-
|
264
|
-
|
524
|
+
# Loads another environment for the given Vagrantfile, sharing as much
|
525
|
+
# useful state from this Environment as possible (such as UI and paths).
|
526
|
+
# Any initialization options can be overidden using the opts hash.
|
527
|
+
#
|
528
|
+
# @param [String] vagrantfile Path to a Vagrantfile
|
529
|
+
# @return [Environment]
|
530
|
+
def environment(vagrantfile, **opts)
|
531
|
+
path = File.expand_path(vagrantfile, root_path)
|
532
|
+
file = File.basename(path)
|
533
|
+
path = File.dirname(path)
|
534
|
+
|
535
|
+
Util::SilenceWarnings.silence! do
|
536
|
+
Environment.new({
|
537
|
+
child: true,
|
538
|
+
cwd: path,
|
539
|
+
home_path: home_path,
|
540
|
+
ui_class: ui_class,
|
541
|
+
vagrantfile_name: file,
|
542
|
+
}.merge(opts))
|
543
|
+
end
|
265
544
|
end
|
266
545
|
|
267
|
-
# This
|
268
|
-
#
|
269
|
-
#
|
270
|
-
|
271
|
-
|
272
|
-
|
546
|
+
# This defines a hook point where plugin action hooks that are registered
|
547
|
+
# against the given name will be run in the context of this environment.
|
548
|
+
#
|
549
|
+
# @param [Symbol] name Name of the hook.
|
550
|
+
# @param [Action::Runner] action_runner A custom action runner for running hooks.
|
551
|
+
def hook(name, opts=nil)
|
552
|
+
@logger.info("Running hook: #{name}")
|
553
|
+
|
554
|
+
opts ||= {}
|
555
|
+
opts[:callable] ||= Action::Builder.new
|
556
|
+
opts[:runner] ||= action_runner
|
557
|
+
opts[:action_name] = name
|
558
|
+
opts[:env] = self
|
559
|
+
opts.delete(:runner).run(opts.delete(:callable), opts)
|
560
|
+
end
|
273
561
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
562
|
+
# Returns the host object associated with this environment.
|
563
|
+
#
|
564
|
+
# @return [Class]
|
565
|
+
def host
|
566
|
+
return @host if defined?(@host)
|
279
567
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
568
|
+
# Determine the host class to use. ":detect" is an old Vagrant config
|
569
|
+
# that shouldn't be valid anymore, but we respect it here by assuming
|
570
|
+
# its old behavior. No need to deprecate this because I thin it is
|
571
|
+
# fairly harmless.
|
572
|
+
host_klass = vagrantfile.config.vagrant.host
|
573
|
+
host_klass = nil if host_klass == :detect
|
574
|
+
|
575
|
+
begin
|
576
|
+
@host = Host.new(
|
577
|
+
host_klass,
|
578
|
+
Vagrant.plugin("2").manager.hosts,
|
579
|
+
Vagrant.plugin("2").manager.host_capabilities,
|
580
|
+
self)
|
581
|
+
rescue Errors::CapabilityHostNotDetected
|
582
|
+
# If the auto-detect failed, then we create a brand new host
|
583
|
+
# with no capabilities and use that. This should almost never happen
|
584
|
+
# since Vagrant works on most host OS's now, so this is a "slow path"
|
585
|
+
klass = Class.new(Vagrant.plugin("2", :host)) do
|
586
|
+
def detect?(env); true; end
|
290
587
|
end
|
588
|
+
|
589
|
+
hosts = { generic: [klass, nil] }
|
590
|
+
host_caps = {}
|
591
|
+
|
592
|
+
@host = Host.new(:generic, hosts, host_caps, self)
|
593
|
+
rescue Errors::CapabilityHostExplicitNotDetected => e
|
594
|
+
raise Errors::HostExplicitNotDetected, e.extra_data
|
291
595
|
end
|
292
596
|
end
|
293
597
|
|
294
|
-
|
295
|
-
# Config Methods
|
296
|
-
#---------------------------------------------------------------
|
297
|
-
|
298
|
-
# The configuration object represented by this environment. This
|
299
|
-
# will trigger the environment to load if it hasn't loaded yet (see
|
300
|
-
# {#load!}).
|
598
|
+
# This acquires a process-level lock with the given name.
|
301
599
|
#
|
302
|
-
#
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
600
|
+
# The lock file is held within the data directory of this environment,
|
601
|
+
# so make sure that all environments that are locking are sharing
|
602
|
+
# the same data directory.
|
603
|
+
#
|
604
|
+
# This will raise Errors::EnvironmentLockedError if the lock can't
|
605
|
+
# be obtained.
|
606
|
+
#
|
607
|
+
# @param [String] name Name of the lock, since multiple locks can
|
608
|
+
# be held at one time.
|
609
|
+
def lock(name="global", **opts)
|
610
|
+
f = nil
|
307
611
|
|
308
|
-
|
309
|
-
|
310
|
-
#---------------------------------------------------------------
|
612
|
+
# If we don't have a block, then locking is useless, so ignore it
|
613
|
+
return if !block_given?
|
311
614
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
!!@loaded
|
318
|
-
end
|
615
|
+
# This allows multiple locks in the same process to be nested
|
616
|
+
return yield if @locks[name] || opts[:noop]
|
617
|
+
|
618
|
+
# The path to this lock
|
619
|
+
lock_path = data_dir.join("lock.#{name}.lock")
|
319
620
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
def load!
|
324
|
-
if !loaded?
|
325
|
-
@loaded = true
|
326
|
-
@logger.info("Loading configuration...")
|
327
|
-
load_config!
|
621
|
+
@logger.debug("Attempting to acquire process-lock: #{name}")
|
622
|
+
lock("dotlock", noop: name == "dotlock", retry: true) do
|
623
|
+
f = File.open(lock_path, "w+")
|
328
624
|
end
|
329
625
|
|
330
|
-
|
331
|
-
|
626
|
+
# The file locking fails only if it returns "false." If it
|
627
|
+
# succeeds it returns a 0, so we must explicitly check for
|
628
|
+
# the proper error case.
|
629
|
+
while f.flock(File::LOCK_EX | File::LOCK_NB) === false
|
630
|
+
@logger.warn("Process-lock in use: #{name}")
|
332
631
|
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
632
|
+
if !opts[:retry]
|
633
|
+
raise Errors::EnvironmentLockedError,
|
634
|
+
name: name
|
635
|
+
end
|
337
636
|
|
338
|
-
|
339
|
-
|
340
|
-
end
|
637
|
+
sleep 0.2
|
638
|
+
end
|
341
639
|
|
342
|
-
|
343
|
-
# variable. The configuration loaded by this method is specified to
|
344
|
-
# this environment, meaning that it will use the given root directory
|
345
|
-
# to load the Vagrantfile into that context.
|
346
|
-
def load_config!
|
347
|
-
# Initialize the config loader
|
348
|
-
config_loader = Config::Loader.new
|
349
|
-
config_loader.load_order = [:default, :box, :home, :root, :vm]
|
640
|
+
@logger.info("Acquired process lock: #{name}")
|
350
641
|
|
351
|
-
|
352
|
-
|
353
|
-
#
|
354
|
-
|
355
|
-
subvm = args[0]
|
356
|
-
box = args[1]
|
642
|
+
result = nil
|
643
|
+
begin
|
644
|
+
# Mark that we have a lock
|
645
|
+
@locks[name] = true
|
357
646
|
|
358
|
-
|
359
|
-
|
360
|
-
|
647
|
+
result = yield
|
648
|
+
ensure
|
649
|
+
# We need to make sure that no matter what this is always
|
650
|
+
# reset to false so we don't think we have a lock when we
|
651
|
+
# actually don't.
|
652
|
+
@locks.delete(name)
|
653
|
+
@logger.info("Released process lock: #{name}")
|
654
|
+
end
|
361
655
|
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
656
|
+
# Clean up the lock file, this requires another lock
|
657
|
+
if name != "dotlock"
|
658
|
+
lock("dotlock", retry: true) do
|
659
|
+
f.close
|
660
|
+
begin
|
661
|
+
File.delete(lock_path)
|
662
|
+
rescue
|
663
|
+
@logger.error(
|
664
|
+
"Failed to delete lock file #{lock_path} - some other thread " +
|
665
|
+
"might be trying to acquire it. ignoring this error")
|
666
|
+
end
|
366
667
|
end
|
668
|
+
end
|
367
669
|
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
670
|
+
# Return the result
|
671
|
+
return result
|
672
|
+
ensure
|
673
|
+
begin
|
674
|
+
f.close if f
|
675
|
+
rescue IOError
|
676
|
+
end
|
677
|
+
end
|
373
678
|
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
679
|
+
# This executes the push with the given name, raising any exceptions that
|
680
|
+
# occur.
|
681
|
+
#
|
682
|
+
# @param name [String] Push plugin name
|
683
|
+
# @param manager [Vagrant::Plugin::Manager] Plugin Manager to use,
|
684
|
+
# defaults to the primary one registered but parameterized so it can be
|
685
|
+
# overridden in server mode
|
686
|
+
#
|
687
|
+
# @see VagrantPlugins::CommandServe::Service::PushService Server mode behavior
|
688
|
+
#
|
689
|
+
# Precondition: the push is not nil and exists.
|
690
|
+
def push(name, manager: Vagrant.plugin("2").manager)
|
691
|
+
@logger.info("Getting push: #{name}")
|
379
692
|
|
380
|
-
|
381
|
-
# We have subvm configuration, so set that up as well.
|
382
|
-
config_loader.set(:vm, subvm.proc_stack)
|
383
|
-
end
|
693
|
+
name = name.to_sym
|
384
694
|
|
385
|
-
|
386
|
-
|
387
|
-
|
695
|
+
pushes = self.vagrantfile.config.push.__compiled_pushes
|
696
|
+
if !pushes.key?(name)
|
697
|
+
raise Vagrant::Errors::PushStrategyNotDefined,
|
698
|
+
name: name,
|
699
|
+
pushes: pushes.keys
|
388
700
|
end
|
389
701
|
|
390
|
-
|
391
|
-
|
392
|
-
|
702
|
+
strategy, config = pushes[name]
|
703
|
+
push_registry = manager.pushes
|
704
|
+
klass, _ = push_registry.get(strategy)
|
705
|
+
if klass.nil?
|
706
|
+
raise Vagrant::Errors::PushStrategyNotLoaded,
|
707
|
+
name: strategy,
|
708
|
+
pushes: push_registry.keys
|
709
|
+
end
|
393
710
|
|
394
|
-
|
395
|
-
|
396
|
-
# first pass is used to determine the box for the VM. The second pass
|
397
|
-
# is used to also load the box Vagrantfile.
|
398
|
-
defined_vm_keys = global.vm.defined_vm_keys.dup
|
399
|
-
defined_vms = global.vm.defined_vms.dup
|
711
|
+
klass.new(self, config).push
|
712
|
+
end
|
400
713
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
714
|
+
# The list of pushes defined in this Vagrantfile.
|
715
|
+
#
|
716
|
+
# @return [Array<Symbol>]
|
717
|
+
def pushes
|
718
|
+
self.vagrantfile.config.push.__compiled_pushes.keys
|
719
|
+
end
|
720
|
+
|
721
|
+
# This returns a machine with the proper provider for this environment.
|
722
|
+
# The machine named by `name` must be in this environment.
|
723
|
+
#
|
724
|
+
# @param [Symbol] name Name of the machine (as configured in the
|
725
|
+
# Vagrantfile).
|
726
|
+
# @param [Symbol] provider The provider that this machine should be
|
727
|
+
# backed by.
|
728
|
+
# @param [Boolean] refresh If true, then if there is a cached version
|
729
|
+
# it is reloaded.
|
730
|
+
# @return [Machine]
|
731
|
+
def machine(name, provider, refresh=false)
|
732
|
+
@logger.info("Getting machine: #{name} (#{provider})")
|
733
|
+
|
734
|
+
# Compose the cache key of the name and provider, and return from
|
735
|
+
# the cache if we have that.
|
736
|
+
cache_key = [name, provider]
|
737
|
+
@machines ||= {}
|
738
|
+
if refresh
|
739
|
+
@logger.info("Refreshing machine (busting cache): #{name} (#{provider})")
|
740
|
+
@machines.delete(cache_key)
|
406
741
|
end
|
407
742
|
|
408
|
-
|
409
|
-
@logger.
|
743
|
+
if @machines.key?(cache_key)
|
744
|
+
@logger.info("Returning cached machine: #{name} (#{provider})")
|
745
|
+
return @machines[cache_key]
|
746
|
+
end
|
410
747
|
|
411
|
-
|
748
|
+
@logger.info("Uncached load of machine.")
|
412
749
|
|
413
|
-
|
414
|
-
|
750
|
+
# Determine the machine data directory and pass it to the machine.
|
751
|
+
machine_data_path = @local_data_path.join(
|
752
|
+
"machines/#{name}/#{provider}")
|
415
753
|
|
416
|
-
|
417
|
-
|
418
|
-
|
754
|
+
# Create the machine and cache it for future calls. This will also
|
755
|
+
# return the machine from this method.
|
756
|
+
@machines[cache_key] = vagrantfile.machine(
|
757
|
+
name, provider, boxes, machine_data_path, self)
|
758
|
+
end
|
419
759
|
|
420
|
-
|
421
|
-
|
422
|
-
|
760
|
+
# The {MachineIndex} to store information about the machines.
|
761
|
+
#
|
762
|
+
# @return [MachineIndex]
|
763
|
+
def machine_index
|
764
|
+
@machine_index ||= MachineIndex.new(@machine_index_dir)
|
765
|
+
end
|
423
766
|
|
424
|
-
|
425
|
-
|
767
|
+
# This returns a list of the configured machines for this environment.
|
768
|
+
# Each of the names returned by this method is valid to be used with
|
769
|
+
# the {#machine} method.
|
770
|
+
#
|
771
|
+
# @return [Array<Symbol>] Configured machine names.
|
772
|
+
def machine_names
|
773
|
+
vagrantfile.machine_names
|
426
774
|
end
|
427
775
|
|
428
|
-
#
|
429
|
-
|
430
|
-
|
776
|
+
# This returns the name of the machine that is the "primary." In the
|
777
|
+
# case of a single-machine environment, this is just the single machine
|
778
|
+
# name. In the case of a multi-machine environment, then this can
|
779
|
+
# potentially be nil if no primary machine is specified.
|
780
|
+
#
|
781
|
+
# @return [Symbol]
|
782
|
+
def primary_machine_name
|
783
|
+
vagrantfile.primary_machine_name
|
784
|
+
end
|
431
785
|
|
432
|
-
|
433
|
-
|
434
|
-
|
786
|
+
# The root path is the path where the top-most (loaded last)
|
787
|
+
# Vagrantfile resides. It can be considered the project root for
|
788
|
+
# this environment.
|
789
|
+
#
|
790
|
+
# @return [String]
|
791
|
+
def root_path
|
792
|
+
return @root_path if defined?(@root_path)
|
793
|
+
|
794
|
+
root_finder = lambda do |path|
|
795
|
+
# Note: To remain compatible with Ruby 1.8, we have to use
|
796
|
+
# a `find` here instead of an `each`.
|
797
|
+
vf = find_vagrantfile(path, @vagrantfile_name)
|
798
|
+
return path if vf
|
799
|
+
return nil if path.root? || !File.exist?(path)
|
800
|
+
root_finder.call(path.parent)
|
435
801
|
end
|
436
802
|
|
437
|
-
|
803
|
+
@root_path = root_finder.call(cwd)
|
804
|
+
end
|
805
|
+
|
806
|
+
# Unload the environment, running completion hooks. The environment
|
807
|
+
# should not be used after this (but CAN be, technically). It is
|
808
|
+
# recommended to always immediately set the variable to `nil` after
|
809
|
+
# running this so you can't accidentally run any more methods. Example:
|
810
|
+
#
|
811
|
+
# env.unload
|
812
|
+
# env = nil
|
813
|
+
#
|
814
|
+
def unload
|
815
|
+
hook(:environment_unload)
|
438
816
|
end
|
439
817
|
|
818
|
+
# Represents the default Vagrantfile, or the Vagrantfile that is
|
819
|
+
# in the working directory or a parent of the working directory
|
820
|
+
# of this environment.
|
821
|
+
#
|
822
|
+
# The existence of this function is primarily a convenience. There
|
823
|
+
# is nothing stopping you from instantiating your own {Vagrantfile}
|
824
|
+
# and loading machines in any way you see fit. Typical behavior of
|
825
|
+
# Vagrant, however, loads this Vagrantfile.
|
826
|
+
#
|
827
|
+
# This Vagrantfile is comprised of two major sources: the Vagrantfile
|
828
|
+
# in the user's home directory as well as the "root" Vagrantfile or
|
829
|
+
# the Vagrantfile in the working directory (or parent).
|
830
|
+
#
|
831
|
+
# @return [Vagrantfile]
|
832
|
+
def vagrantfile
|
833
|
+
@vagrantfile ||= Vagrantfile.new(config_loader, [:home, :root])
|
834
|
+
end
|
835
|
+
|
836
|
+
#---------------------------------------------------------------
|
837
|
+
# Load Methods
|
838
|
+
#---------------------------------------------------------------
|
839
|
+
|
440
840
|
# This sets the `@home_path` variable properly.
|
441
841
|
#
|
442
842
|
# @return [Pathname]
|
443
843
|
def setup_home_path
|
444
|
-
@home_path = Pathname.new(File.expand_path(@home_path ||
|
445
|
-
ENV["VAGRANT_HOME"] ||
|
446
|
-
DEFAULT_HOME))
|
447
844
|
@logger.info("Home path: #{@home_path}")
|
448
845
|
|
449
|
-
#
|
450
|
-
#
|
451
|
-
|
452
|
-
@home_path
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
846
|
+
# Setup the list of child directories that need to be created if they
|
847
|
+
# don't already exist.
|
848
|
+
dirs = [
|
849
|
+
@home_path,
|
850
|
+
@home_path.join("rgloader"),
|
851
|
+
@boxes_path,
|
852
|
+
@data_dir,
|
853
|
+
@gems_path,
|
854
|
+
@tmp_path,
|
855
|
+
@machine_index_dir,
|
856
|
+
]
|
457
857
|
|
458
858
|
# Go through each required directory, creating it if it doesn't exist
|
459
859
|
dirs.each do |dir|
|
@@ -462,26 +862,239 @@ module Vagrant
|
|
462
862
|
begin
|
463
863
|
@logger.info("Creating: #{dir}")
|
464
864
|
FileUtils.mkdir_p(dir)
|
465
|
-
rescue Errno::EACCES
|
466
|
-
raise Errors::HomeDirectoryNotAccessible, :
|
865
|
+
rescue Errno::EACCES, Errno::EROFS
|
866
|
+
raise Errors::HomeDirectoryNotAccessible, home_path: @home_path.to_s
|
867
|
+
end
|
868
|
+
end
|
869
|
+
|
870
|
+
# Attempt to write into the home directory to verify we can
|
871
|
+
begin
|
872
|
+
# Append a random suffix to avoid race conditions if Vagrant
|
873
|
+
# is running in parallel with other Vagrant processes.
|
874
|
+
suffix = (0...32).map { (65 + rand(26)).chr }.join
|
875
|
+
path = @home_path.join("perm_test_#{suffix}")
|
876
|
+
path.open("w") do |f|
|
877
|
+
f.write("hello")
|
467
878
|
end
|
879
|
+
path.unlink
|
880
|
+
rescue Errno::EACCES
|
881
|
+
raise Errors::HomeDirectoryNotAccessible, home_path: @home_path.to_s
|
882
|
+
end
|
883
|
+
|
884
|
+
# Create the version file that we use to track the structure of
|
885
|
+
# the home directory. If we have an old version, we need to explicitly
|
886
|
+
# upgrade it. Otherwise, we just mark that its the current version.
|
887
|
+
version_file = @home_path.join("setup_version")
|
888
|
+
if version_file.file?
|
889
|
+
version = version_file.read.chomp
|
890
|
+
if version > CURRENT_SETUP_VERSION
|
891
|
+
raise Errors::HomeDirectoryLaterVersion
|
892
|
+
end
|
893
|
+
|
894
|
+
case version
|
895
|
+
when CURRENT_SETUP_VERSION
|
896
|
+
# We're already good, at the latest version.
|
897
|
+
when "1.1"
|
898
|
+
# We need to update our directory structure
|
899
|
+
upgrade_home_path_v1_1
|
900
|
+
|
901
|
+
# Delete the version file so we put our latest version in
|
902
|
+
version_file.delete
|
903
|
+
else
|
904
|
+
raise Errors::HomeDirectoryUnknownVersion,
|
905
|
+
path: @home_path.to_s,
|
906
|
+
version: version
|
907
|
+
end
|
908
|
+
end
|
909
|
+
|
910
|
+
if !version_file.file?
|
911
|
+
@logger.debug(
|
912
|
+
"Creating home directory version file: #{CURRENT_SETUP_VERSION}")
|
913
|
+
version_file.open("w") do |f|
|
914
|
+
f.write(CURRENT_SETUP_VERSION)
|
915
|
+
end
|
916
|
+
end
|
917
|
+
|
918
|
+
# Create the rgloader/loader file so we can use encoded files.
|
919
|
+
loader_file = @home_path.join("rgloader", "loader.rb")
|
920
|
+
if !loader_file.file?
|
921
|
+
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
|
922
|
+
FileUtils.cp(source_loader.to_s, loader_file.to_s)
|
923
|
+
end
|
924
|
+
end
|
925
|
+
|
926
|
+
# This creates the local data directory and show an error if it
|
927
|
+
# couldn't properly be created.
|
928
|
+
def setup_local_data_path(force=false)
|
929
|
+
if @local_data_path.nil?
|
930
|
+
@logger.warn("No local data path is set. Local data cannot be stored.")
|
931
|
+
return
|
932
|
+
end
|
933
|
+
|
934
|
+
@logger.info("Local data path: #{@local_data_path}")
|
935
|
+
|
936
|
+
# If the local data path is a file, then we are probably seeing an
|
937
|
+
# old (V1) "dotfile." In this case, we upgrade it. The upgrade process
|
938
|
+
# will remove the old data file if it is successful.
|
939
|
+
if @local_data_path.file?
|
940
|
+
upgrade_v1_dotfile(@local_data_path)
|
941
|
+
end
|
942
|
+
|
943
|
+
# If we don't have a root path, we don't setup anything
|
944
|
+
return if !force && root_path.nil?
|
945
|
+
|
946
|
+
begin
|
947
|
+
@logger.debug("Creating: #{@local_data_path}")
|
948
|
+
FileUtils.mkdir_p(@local_data_path)
|
949
|
+
# Create the rgloader/loader file so we can use encoded files.
|
950
|
+
loader_file = @local_data_path.join("rgloader", "loader.rb")
|
951
|
+
if !loader_file.file?
|
952
|
+
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
|
953
|
+
FileUtils.mkdir_p(@local_data_path.join("rgloader").to_s)
|
954
|
+
FileUtils.cp(source_loader.to_s, loader_file.to_s)
|
955
|
+
end
|
956
|
+
rescue Errno::EACCES
|
957
|
+
raise Errors::LocalDataDirectoryNotAccessible,
|
958
|
+
local_data_path: @local_data_path.to_s
|
468
959
|
end
|
469
960
|
end
|
470
961
|
|
471
962
|
protected
|
472
963
|
|
473
|
-
#
|
474
|
-
#
|
964
|
+
# Attempt to guess the configured provider in use. Will fallback
|
965
|
+
# to the default provider if an explicit provider name is not
|
966
|
+
# provided. This can be pretty error prone, but is used during
|
967
|
+
# initial environment setup to allow loading plugins so it doesn't
|
968
|
+
# need to be perfect
|
969
|
+
#
|
970
|
+
# @return [String]
|
971
|
+
def guess_provider
|
972
|
+
gp = nil
|
973
|
+
ARGV.each_with_index do |val, idx|
|
974
|
+
if val.start_with?("--provider=")
|
975
|
+
gp = val.split("=", 2).last
|
976
|
+
break
|
977
|
+
elsif val == "--provider"
|
978
|
+
gp = ARGV[idx+1]
|
979
|
+
break
|
980
|
+
end
|
981
|
+
end
|
982
|
+
return gp.to_sym if gp
|
983
|
+
begin
|
984
|
+
default_provider
|
985
|
+
rescue Errors::NoDefaultProvider
|
986
|
+
# if a provider cannot be determined just return nil
|
987
|
+
nil
|
988
|
+
end
|
989
|
+
end
|
990
|
+
|
991
|
+
# Load any configuration provided by guests defined within
|
992
|
+
# the Vagrantfile to pull plugin information they may have
|
993
|
+
# defined.
|
994
|
+
def find_configured_plugins
|
995
|
+
plugins = []
|
996
|
+
provider = guess_provider
|
997
|
+
vagrantfile.machine_names.each do |mname|
|
998
|
+
ldp = @local_data_path.join("machines/#{mname}/#{provider}") if @local_data_path
|
999
|
+
plugins << vagrantfile.machine_config(mname, provider, boxes, ldp, false)[:config]
|
1000
|
+
end
|
1001
|
+
result = plugins.reverse.inject(Vagrant::Util::HashWithIndifferentAccess.new) do |memo, val|
|
1002
|
+
Vagrant::Util::DeepMerge.deep_merge(memo, val.vagrant.plugins)
|
1003
|
+
end
|
1004
|
+
Vagrant::Util::DeepMerge.deep_merge(result, vagrantfile.config.vagrant.plugins)
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
# Check for any local plugins defined within the Vagrantfile. If
|
1008
|
+
# found, validate they are available. If they are not available,
|
1009
|
+
# request to install them, or raise an exception
|
1010
|
+
#
|
1011
|
+
# @return [Hash] plugin list for loading
|
1012
|
+
def process_configured_plugins
|
1013
|
+
return if !Vagrant.plugins_enabled?
|
1014
|
+
errors = vagrantfile.config.vagrant.validate(nil)
|
1015
|
+
if !Array(errors["vagrant"]).empty?
|
1016
|
+
raise Errors::ConfigInvalid,
|
1017
|
+
errors: Util::TemplateRenderer.render(
|
1018
|
+
"config/validation_failed",
|
1019
|
+
errors: {vagrant: errors["vagrant"]}
|
1020
|
+
)
|
1021
|
+
end
|
1022
|
+
# Check if defined plugins are installed
|
1023
|
+
installed = Plugin::Manager.instance.installed_plugins
|
1024
|
+
needs_install = []
|
1025
|
+
config_plugins = find_configured_plugins
|
1026
|
+
config_plugins.each do |name, info|
|
1027
|
+
if !installed[name]
|
1028
|
+
needs_install << name
|
1029
|
+
end
|
1030
|
+
end
|
1031
|
+
if !needs_install.empty?
|
1032
|
+
ui.warn(I18n.t("vagrant.plugins.local.uninstalled_plugins",
|
1033
|
+
plugins: needs_install.sort.join(", ")))
|
1034
|
+
if !Vagrant.auto_install_local_plugins?
|
1035
|
+
answer = nil
|
1036
|
+
until ["y", "n"].include?(answer)
|
1037
|
+
answer = ui.ask(I18n.t("vagrant.plugins.local.request_plugin_install") + " [N]: ")
|
1038
|
+
answer = answer.strip.downcase
|
1039
|
+
answer = "n" if answer.to_s.empty?
|
1040
|
+
end
|
1041
|
+
if answer == "n"
|
1042
|
+
raise Errors::PluginMissingLocalError,
|
1043
|
+
plugins: needs_install.sort.join(", ")
|
1044
|
+
end
|
1045
|
+
end
|
1046
|
+
needs_install.each do |name|
|
1047
|
+
pconfig = Util::HashWithIndifferentAccess.new(config_plugins[name])
|
1048
|
+
ui.info(I18n.t("vagrant.commands.plugin.installing", name: name))
|
1049
|
+
|
1050
|
+
options = {sources: Vagrant::Bundler::DEFAULT_GEM_SOURCES.dup, env_local: true}
|
1051
|
+
options[:sources] = pconfig[:sources] if pconfig[:sources]
|
1052
|
+
options[:require] = pconfig[:entry_point] if pconfig[:entry_point]
|
1053
|
+
options[:version] = pconfig[:version] if pconfig[:version]
|
1054
|
+
|
1055
|
+
spec = Plugin::Manager.instance.install_plugin(name, **options)
|
1056
|
+
|
1057
|
+
ui.info(I18n.t("vagrant.commands.plugin.installed",
|
1058
|
+
name: spec.name, version: spec.version.to_s))
|
1059
|
+
end
|
1060
|
+
ui.info("\n")
|
1061
|
+
# Force halt after installation and require command to be run again. This
|
1062
|
+
# will proper load any new locally installed plugins which are now available.
|
1063
|
+
ui.warn(I18n.t("vagrant.plugins.local.install_rerun_command"))
|
1064
|
+
exit(-1)
|
1065
|
+
end
|
1066
|
+
if Vagrant::Plugin::Manager.instance.local_file
|
1067
|
+
Vagrant::Plugin::Manager.instance.local_file.installed_plugins
|
1068
|
+
else
|
1069
|
+
{}
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
# This method copies the private keys into the home directory if they
|
1074
|
+
# do not already exist. The `default_private_key_path` references the
|
1075
|
+
# original rsa based private key and is retained for compatibility. The
|
1076
|
+
# `default_private_keys_directory` contains the list of valid private
|
1077
|
+
# keys supported by Vagrant.
|
475
1078
|
#
|
476
|
-
#
|
1079
|
+
# NOTE: The keys are copied because `ssh` requires that the key is chmod
|
477
1080
|
# 0600, but if Vagrant is installed as a separate user, then the
|
478
1081
|
# effective uid won't be able to read the key. So the key is copied
|
479
1082
|
# to the home directory and chmod 0600.
|
480
|
-
def
|
1083
|
+
def copy_insecure_private_keys
|
1084
|
+
# First setup the deprecated single key path
|
481
1085
|
if !@default_private_key_path.exist?
|
482
1086
|
@logger.info("Copying private key to home directory")
|
483
|
-
|
484
|
-
|
1087
|
+
|
1088
|
+
source = File.expand_path("keys/vagrant", Vagrant.source_root)
|
1089
|
+
destination = @default_private_key_path
|
1090
|
+
|
1091
|
+
begin
|
1092
|
+
FileUtils.cp(source, destination)
|
1093
|
+
rescue Errno::EACCES
|
1094
|
+
raise Errors::CopyPrivateKeyFailed,
|
1095
|
+
source: source,
|
1096
|
+
destination: destination
|
1097
|
+
end
|
485
1098
|
end
|
486
1099
|
|
487
1100
|
if !Util::Platform.windows?
|
@@ -492,31 +1105,126 @@ module Vagrant
|
|
492
1105
|
@default_private_key_path.chmod(0600)
|
493
1106
|
end
|
494
1107
|
end
|
1108
|
+
|
1109
|
+
# Now setup the key directory
|
1110
|
+
Dir.glob(File.expand_path("keys/vagrant.key.*", Vagrant.source_root)).each do |source|
|
1111
|
+
destination = default_private_keys_directory.join(File.basename(source))
|
1112
|
+
default_private_key_paths << destination
|
1113
|
+
next if File.exist?(destination)
|
1114
|
+
begin
|
1115
|
+
FileUtils.cp(source, destination)
|
1116
|
+
rescue Errno::EACCES
|
1117
|
+
raise Errors::CopyPrivateKeyFailed,
|
1118
|
+
source: source,
|
1119
|
+
destination: destination
|
1120
|
+
end
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
if !Util::Platform.windows?
|
1124
|
+
default_private_key_paths.each do |key_path|
|
1125
|
+
if Util::FileMode.from_octal(key_path.stat.mode) != "600"
|
1126
|
+
@logger.info("Changing permissions on private key (#{key_path}) to 0600")
|
1127
|
+
key_path.chmod(0600)
|
1128
|
+
end
|
1129
|
+
end
|
1130
|
+
end
|
495
1131
|
end
|
496
1132
|
|
497
1133
|
# Finds the Vagrantfile in the given directory.
|
498
1134
|
#
|
499
1135
|
# @param [Pathname] path Path to search in.
|
500
1136
|
# @return [Pathname]
|
501
|
-
def find_vagrantfile(search_path)
|
502
|
-
|
1137
|
+
def find_vagrantfile(search_path, filenames=nil)
|
1138
|
+
filenames ||= ["Vagrantfile", "vagrantfile"]
|
1139
|
+
filenames.each do |vagrantfile|
|
503
1140
|
current_path = search_path.join(vagrantfile)
|
504
|
-
return current_path if current_path.
|
1141
|
+
return current_path if current_path.file?
|
505
1142
|
end
|
506
1143
|
|
507
1144
|
nil
|
508
1145
|
end
|
509
1146
|
|
510
|
-
#
|
511
|
-
#
|
512
|
-
def
|
513
|
-
#
|
514
|
-
|
515
|
-
|
516
|
-
|
1147
|
+
# Returns the key used for the host capability for provider installs
|
1148
|
+
# of the given name.
|
1149
|
+
def provider_install_key(name)
|
1150
|
+
"provider_install_#{name}".to_sym
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
# This upgrades a home directory that was in the v1.1 format to the
|
1154
|
+
# v1.5 format. It will raise exceptions if anything fails.
|
1155
|
+
def upgrade_home_path_v1_1
|
1156
|
+
if !ENV["VAGRANT_UPGRADE_SILENT_1_5"]
|
1157
|
+
@ui.ask(I18n.t("vagrant.upgrading_home_path_v1_5"))
|
1158
|
+
end
|
1159
|
+
|
1160
|
+
collection = BoxCollection.new(
|
1161
|
+
@home_path.join("boxes"), temp_dir_root: tmp_path)
|
1162
|
+
collection.upgrade_v1_1_v1_5
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
# This upgrades a Vagrant 1.0.x "dotfile" to the new V2 format.
|
1166
|
+
#
|
1167
|
+
# This is a destructive process. Once the upgrade is complete, the
|
1168
|
+
# old dotfile is removed, and the environment becomes incompatible for
|
1169
|
+
# Vagrant 1.0 environments.
|
1170
|
+
#
|
1171
|
+
# @param [Pathname] path The path to the dotfile
|
1172
|
+
def upgrade_v1_dotfile(path)
|
1173
|
+
@logger.info("Upgrading V1 dotfile to V2 directory structure...")
|
1174
|
+
|
1175
|
+
# First, verify the file isn't empty. If it is an empty file, we
|
1176
|
+
# just delete it and go on with life.
|
1177
|
+
contents = path.read.strip
|
1178
|
+
if contents.strip == ""
|
1179
|
+
@logger.info("V1 dotfile was empty. Removing and moving on.")
|
1180
|
+
path.delete
|
1181
|
+
return
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
# Otherwise, verify there is valid JSON in here since a Vagrant
|
1185
|
+
# environment would always ensure valid JSON. This is a sanity check
|
1186
|
+
# to make sure we don't nuke a dotfile that is not ours...
|
1187
|
+
@logger.debug("Attempting to parse JSON of V1 file")
|
1188
|
+
json_data = nil
|
1189
|
+
begin
|
1190
|
+
json_data = JSON.parse(contents)
|
1191
|
+
@logger.debug("JSON parsed successfully. Things are okay.")
|
1192
|
+
rescue JSON::ParserError
|
1193
|
+
# The file could've been tampered with since Vagrant 1.0.x is
|
1194
|
+
# supposed to ensure that the contents are valid JSON. Show an error.
|
1195
|
+
raise Errors::DotfileUpgradeJSONError,
|
1196
|
+
state_file: path.to_s
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
# Alright, let's upgrade this guy to the new structure. Start by
|
1200
|
+
# backing up the old dotfile.
|
1201
|
+
backup_file = path.dirname.join(".vagrant.v1.#{Time.now.to_i}")
|
1202
|
+
@logger.info("Renaming old dotfile to: #{backup_file}")
|
1203
|
+
path.rename(backup_file)
|
1204
|
+
|
1205
|
+
# Now, we create the actual local data directory. This should succeed
|
1206
|
+
# this time since we renamed the old conflicting V1.
|
1207
|
+
setup_local_data_path(true)
|
1208
|
+
|
1209
|
+
if json_data["active"]
|
1210
|
+
@logger.debug("Upgrading to V2 style for each active VM")
|
1211
|
+
json_data["active"].each do |name, id|
|
1212
|
+
@logger.info("Upgrading dotfile: #{name} (#{id})")
|
1213
|
+
|
1214
|
+
# Create the machine configuration directory
|
1215
|
+
directory = @local_data_path.join("machines/#{name}/virtualbox")
|
1216
|
+
FileUtils.mkdir_p(directory)
|
1217
|
+
|
1218
|
+
# Write the ID file
|
1219
|
+
directory.join("id").open("w+") do |f|
|
1220
|
+
f.write(id)
|
1221
|
+
end
|
1222
|
+
end
|
1223
|
+
end
|
517
1224
|
|
518
|
-
#
|
519
|
-
|
1225
|
+
# Upgrade complete! Let the user know
|
1226
|
+
@ui.info(I18n.t("vagrant.general.upgraded_v1_dotfile",
|
1227
|
+
backup_path: backup_file.to_s))
|
520
1228
|
end
|
521
1229
|
end
|
522
1230
|
end
|