vagrant 1.5.0 → 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 +5 -5
- data/.copywrite.hcl +15 -0
- data/.gitignore +79 -14
- data/.gitmodules +0 -0
- data/.vimrc +5 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +4512 -0
- data/Gemfile +10 -2
- data/LICENSE +92 -0
- data/README.md +55 -3
- data/RELEASE.md +11 -0
- data/Rakefile +22 -1
- data/Vagrantfile +31 -0
- data/bin/vagrant +268 -2
- data/contrib/README.md +17 -0
- data/contrib/bash/completion.sh +190 -0
- data/contrib/emacs/vagrant.el +11 -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/vim/vagrantfile.vim +9 -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 +23 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.key.ed25519 +7 -0
- data/keys/vagrant.key.rsa +27 -0
- data/keys/vagrant.pub +2 -0
- data/keys/vagrant.pub.ed25519 +1 -0
- data/keys/vagrant.pub.rsa +1 -0
- data/lib/vagrant/action/builder.rb +356 -0
- 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 +248 -0
- 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 +112 -0
- data/lib/vagrant/action/warden.rb +126 -0
- data/lib/vagrant/action.rb +88 -0
- data/lib/vagrant/alias.rb +59 -0
- data/lib/vagrant/batch_action.rb +181 -0
- data/lib/vagrant/box.rb +260 -0
- data/lib/vagrant/box_collection.rb +563 -0
- 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 +122 -0
- data/lib/vagrant/config/loader.rb +323 -0
- 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 +64 -0
- data/lib/vagrant/environment.rb +1230 -0
- data/lib/vagrant/errors.rb +1158 -0
- data/lib/vagrant/guest.rb +72 -0
- 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 +11 -0
- data/lib/vagrant/registry.rb +113 -0
- data/lib/vagrant/shared_helpers.rb +238 -0
- data/lib/vagrant/ui.rb +449 -0
- data/lib/vagrant/util/ansi_escape_code_remover.rb +37 -0
- data/lib/vagrant/util/busy.rb +62 -0
- 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 +27 -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 +77 -0
- data/lib/vagrant/util/file_mode.rb +15 -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 +66 -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 +31 -0
- 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 +17 -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 +27 -0
- data/lib/vagrant/util/numeric.rb +92 -0
- data/lib/vagrant/util/platform.rb +737 -0
- data/lib/vagrant/util/powershell.rb +316 -0
- data/lib/vagrant/util/presence.rb +48 -0
- data/lib/vagrant/util/retryable.rb +34 -0
- 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 +78 -0
- data/lib/vagrant/util/safe_puts.rb +34 -0
- 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 +38 -0
- data/lib/vagrant/util/string_block_editor.rb +80 -0
- data/lib/vagrant/util/subprocess.rb +365 -0
- data/lib/vagrant/util/template_renderer.rb +91 -0
- 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 +63 -0
- data/lib/vagrant/vagrantfile.rb +320 -0
- data/lib/vagrant/version.rb +10 -0
- data/lib/vagrant.rb +380 -0
- 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 +22 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +8 -0
- data/templates/commands/init/Vagrantfile.erb +86 -0
- data/templates/commands/init/Vagrantfile.min.erb +12 -0
- data/templates/commands/ssh_config/config.erb +42 -0
- data/templates/commands/winrm_config/config.erb +11 -0
- data/templates/config/messages.erb +14 -0
- data/templates/config/validation_failed.erb +7 -0
- 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 +13 -0
- data/templates/guests/debian/network_static.erb +10 -0
- data/templates/guests/debian/network_static6.erb +10 -0
- data/templates/guests/freebsd/network_dhcp.erb +4 -0
- data/templates/guests/freebsd/network_static.erb +6 -0
- 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 +4 -0
- data/templates/guests/gentoo/network_static.erb +8 -0
- 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 +7 -0
- data/templates/guests/redhat/network_static.erb +16 -0
- 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 +3149 -0
- 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 +7 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/provisioners/chef_client/client.erb +41 -0
- data/templates/provisioners/chef_solo/solo.erb +52 -0
- 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 +113 -20
- data/version.txt +1 -0
- metadata +1621 -43
- data/LICENSE.txt +0 -22
- data/message.txt +0 -17
@@ -0,0 +1,737 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
require "rbconfig"
|
5
|
+
require "shellwords"
|
6
|
+
require "tempfile"
|
7
|
+
require "tmpdir"
|
8
|
+
require "log4r"
|
9
|
+
|
10
|
+
require "vagrant/util/subprocess"
|
11
|
+
require "vagrant/util/powershell"
|
12
|
+
require "vagrant/util/which"
|
13
|
+
|
14
|
+
module Vagrant
|
15
|
+
module Util
|
16
|
+
# This class just contains some platform checking code.
|
17
|
+
class Platform
|
18
|
+
class << self
|
19
|
+
|
20
|
+
# Detect architecture of host system
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
def architecture
|
24
|
+
if !defined?(@_host_architecture)
|
25
|
+
if ENV["VAGRANT_HOST_ARCHITECTURE"].to_s != ""
|
26
|
+
return @_host_architecture = ENV["VAGRANT_HOST_ARCHITECTURE"]
|
27
|
+
end
|
28
|
+
|
29
|
+
@_host_architecture = case RbConfig::CONFIG["target_cpu"]
|
30
|
+
when "amd64", "x86_64", "x64"
|
31
|
+
"amd64"
|
32
|
+
when "386", "i386", "x86"
|
33
|
+
"i386"
|
34
|
+
when "arm64", "aarch64"
|
35
|
+
"arm64"
|
36
|
+
else
|
37
|
+
RbConfig::CONFIG["target_cpu"]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
@_host_architecture
|
41
|
+
end
|
42
|
+
|
43
|
+
def logger
|
44
|
+
if !defined?(@_logger)
|
45
|
+
@_logger = Log4r::Logger.new("vagrant::util::platform")
|
46
|
+
end
|
47
|
+
@_logger
|
48
|
+
end
|
49
|
+
|
50
|
+
def cygwin?
|
51
|
+
if !defined?(@_cygwin)
|
52
|
+
@_cygwin = ENV["VAGRANT_DETECTED_OS"].to_s.downcase.include?("cygwin") ||
|
53
|
+
platform.include?("cygwin") ||
|
54
|
+
ENV["OSTYPE"].to_s.downcase.include?("cygwin")
|
55
|
+
end
|
56
|
+
@_cygwin
|
57
|
+
end
|
58
|
+
|
59
|
+
def msys?
|
60
|
+
if !defined?(@_msys)
|
61
|
+
@_msys = ENV["VAGRANT_DETECTED_OS"].to_s.downcase.include?("msys") ||
|
62
|
+
platform.include?("msys") ||
|
63
|
+
ENV["OSTYPE"].to_s.downcase.include?("msys")
|
64
|
+
end
|
65
|
+
@_msys
|
66
|
+
end
|
67
|
+
|
68
|
+
def wsl?
|
69
|
+
if !defined?(@_wsl)
|
70
|
+
@_wsl = false
|
71
|
+
SilenceWarnings.silence! do
|
72
|
+
# Find 'microsoft' in /proc/version indicative of WSL
|
73
|
+
if File.file?('/proc/version')
|
74
|
+
osversion = File.open('/proc/version', &:gets)
|
75
|
+
if osversion.downcase.include?("microsoft")
|
76
|
+
@_wsl = true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
@_wsl
|
82
|
+
end
|
83
|
+
|
84
|
+
[:darwin, :bsd, :freebsd, :linux, :solaris].each do |type|
|
85
|
+
define_method("#{type}?") do
|
86
|
+
platform.include?(type.to_s)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def windows?
|
91
|
+
return @_windows if defined?(@_windows)
|
92
|
+
@_windows = %w[mingw mswin].any? { |t| platform.include?(t) }
|
93
|
+
return @_windows
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks if the user running Vagrant on Windows has administrative
|
97
|
+
# privileges.
|
98
|
+
#
|
99
|
+
# From: https://support.microsoft.com/en-us/kb/243330
|
100
|
+
# SID: S-1-5-19
|
101
|
+
#
|
102
|
+
# @return [Boolean]
|
103
|
+
def windows_admin?
|
104
|
+
return @_windows_admin if defined?(@_windows_admin)
|
105
|
+
|
106
|
+
@_windows_admin = -> {
|
107
|
+
ps_cmd = '(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)'
|
108
|
+
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
|
109
|
+
return output == 'True'
|
110
|
+
}.call
|
111
|
+
|
112
|
+
return @_windows_admin
|
113
|
+
end
|
114
|
+
|
115
|
+
# Checks if Hyper-V is accessible to the local user. It will check
|
116
|
+
# if user is in the "Hyper-V Administrators" group, is a Domain
|
117
|
+
# administrator, and finally will run a manual interaction with
|
118
|
+
# Hyper-V to determine if Hyper-V is usable for the current user.
|
119
|
+
#
|
120
|
+
# From: https://support.microsoft.com/en-us/kb/243330
|
121
|
+
# SID: S-1-5-32-578
|
122
|
+
# Name: BUILTIN\Hyper-V Administrators
|
123
|
+
# SID: S-1-5-21DOMAIN-512
|
124
|
+
# Name: Domain Admins
|
125
|
+
#
|
126
|
+
# @return [Boolean]
|
127
|
+
def windows_hyperv_admin?
|
128
|
+
return @_windows_hyperv_admin if defined?(@_windows_hyperv_admin)
|
129
|
+
|
130
|
+
if ENV["VAGRANT_IS_HYPERV_ADMIN"]
|
131
|
+
return @_windows_hyperv_admin = true
|
132
|
+
end
|
133
|
+
|
134
|
+
ps_cmd = "Write-Output ([System.Security.Principal.WindowsIdentity]::GetCurrent().Groups | " \
|
135
|
+
"Select-Object Value | ConvertTo-JSON)"
|
136
|
+
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
|
137
|
+
if output
|
138
|
+
groups = begin
|
139
|
+
JSON.load(output)
|
140
|
+
rescue JSON::ParserError
|
141
|
+
[]
|
142
|
+
end
|
143
|
+
admin_group = groups.detect do |g|
|
144
|
+
g["Value"].to_s == "S-1-5-32-578" ||
|
145
|
+
(g["Value"].start_with?("S-1-5-21") && g["Value"].to_s.end_with?("-512"))
|
146
|
+
end
|
147
|
+
|
148
|
+
if admin_group
|
149
|
+
return @_windows_hyperv_admin = true
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
ps_cmd = "$x = (Get-VMHost).Name; if($x -eq [System.Net.Dns]::GetHostName()){ Write-Output 'true'}"
|
154
|
+
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
|
155
|
+
result = output == "true"
|
156
|
+
|
157
|
+
return @_windows_hyperv_admin = result
|
158
|
+
end
|
159
|
+
|
160
|
+
# Checks if Hyper-V is enabled on the host system and returns true
|
161
|
+
# if enabled.
|
162
|
+
#
|
163
|
+
# @return [Boolean]
|
164
|
+
def windows_hyperv_enabled?
|
165
|
+
return @_windows_hyperv_enabled if defined?(@_windows_hyperv_enabled)
|
166
|
+
|
167
|
+
@_windows_hyperv_enabled = -> {
|
168
|
+
check_commands = Array.new.tap do |c|
|
169
|
+
c << "(Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-Hypervisor -Online).State"
|
170
|
+
c << "(Get-WindowsFeature -FeatureName Microsoft-Hyper-V-Hypervisor).State"
|
171
|
+
end
|
172
|
+
check_commands.each do |ps_cmd|
|
173
|
+
begin
|
174
|
+
output = Vagrant::Util::PowerShell.execute_cmd(ps_cmd)
|
175
|
+
return true if output == "Enabled"
|
176
|
+
rescue Errors::PowerShellInvalidVersion
|
177
|
+
logger.warn("Invalid PowerShell version detected during Hyper-V enable check")
|
178
|
+
return false
|
179
|
+
rescue Errors::PowerShellError
|
180
|
+
logger.warn("Powershell command not found or error on execution of command")
|
181
|
+
return false
|
182
|
+
end
|
183
|
+
end
|
184
|
+
return false
|
185
|
+
}.call
|
186
|
+
|
187
|
+
return @_windows_hyperv_enabled
|
188
|
+
end
|
189
|
+
|
190
|
+
# This takes any path and converts it from a Windows path to a
|
191
|
+
# Cygwin style path.
|
192
|
+
#
|
193
|
+
# @param [String] path
|
194
|
+
# @return [String]
|
195
|
+
def cygwin_path(path)
|
196
|
+
begin
|
197
|
+
cygpath = Vagrant::Util::Which.which("cygpath")
|
198
|
+
if cygpath.nil?
|
199
|
+
# If Which can't find it, just attempt to invoke it directly
|
200
|
+
cygpath = "cygpath"
|
201
|
+
else
|
202
|
+
cygpath.gsub!("/", '\\')
|
203
|
+
end
|
204
|
+
|
205
|
+
process = Subprocess.execute(
|
206
|
+
cygpath, "-u", "-a", path.to_s)
|
207
|
+
return process.stdout.chomp
|
208
|
+
rescue Errors::CommandUnavailableWindows => e
|
209
|
+
# Sometimes cygpath isn't available (msys). Instead, do what we
|
210
|
+
# can with bash tricks.
|
211
|
+
process = Subprocess.execute(
|
212
|
+
"bash",
|
213
|
+
"--noprofile",
|
214
|
+
"--norc",
|
215
|
+
"-c", "cd #{Shellwords.escape(path)} && pwd")
|
216
|
+
return process.stdout.chomp
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# This takes any path and converts it from a Windows path to a
|
221
|
+
# msys style path.
|
222
|
+
#
|
223
|
+
# @param [String] path
|
224
|
+
# @return [String]
|
225
|
+
def msys_path(path)
|
226
|
+
begin
|
227
|
+
# We have to revert to the old env
|
228
|
+
# path here, otherwise it looks like
|
229
|
+
# msys2 ends up using the wrong cygpath
|
230
|
+
# binary and ends up with a `/cygdrive`
|
231
|
+
# when it doesn't exist in msys2
|
232
|
+
original_path_env = ENV['PATH']
|
233
|
+
ENV['PATH'] = ENV['VAGRANT_OLD_ENV_PATH']
|
234
|
+
cygwin_path(path)
|
235
|
+
ensure
|
236
|
+
ENV['PATH'] = original_path_env
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
# This takes any path and converts it to a full-length Windows
|
241
|
+
# path on Windows machines in Cygwin.
|
242
|
+
#
|
243
|
+
# @return [String]
|
244
|
+
def cygwin_windows_path(path)
|
245
|
+
return path if !cygwin?
|
246
|
+
|
247
|
+
# Replace all "\" with "/", otherwise cygpath doesn't work.
|
248
|
+
path = unix_windows_path(path)
|
249
|
+
|
250
|
+
# Call out to cygpath and gather the result
|
251
|
+
process = Subprocess.execute("cygpath", "-w", "-l", "-a", path.to_s)
|
252
|
+
return process.stdout.chomp
|
253
|
+
end
|
254
|
+
|
255
|
+
# This takes any path and converts Windows-style path separators
|
256
|
+
# to Unix-like path separators.
|
257
|
+
# @return [String]
|
258
|
+
def unix_windows_path(path)
|
259
|
+
path.gsub("\\", "/")
|
260
|
+
end
|
261
|
+
|
262
|
+
# This checks if the filesystem is case sensitive. This is not a
|
263
|
+
# 100% correct check, since it is possible that the temporary
|
264
|
+
# directory runs a different filesystem than the root directory.
|
265
|
+
# However, this works in many cases.
|
266
|
+
def fs_case_sensitive?
|
267
|
+
return @_fs_case_sensitive if defined?(@_fs_case_sensitive)
|
268
|
+
@_fs_case_sensitive = Dir.mktmpdir("vagrant-fs-case-sensitive") do |dir|
|
269
|
+
tmp_file = File.join(dir, "FILE")
|
270
|
+
File.open(tmp_file, "w") do |f|
|
271
|
+
f.write("foo")
|
272
|
+
end
|
273
|
+
|
274
|
+
# The filesystem is case sensitive if the lowercased version
|
275
|
+
# of the filename is NOT reported as existing.
|
276
|
+
!File.file?(File.join(dir, "file"))
|
277
|
+
end
|
278
|
+
return @_fs_case_sensitive
|
279
|
+
end
|
280
|
+
|
281
|
+
# This expands the path and ensures proper casing of each part
|
282
|
+
# of the path.
|
283
|
+
def fs_real_path(path, **opts)
|
284
|
+
path = Pathname.new(File.expand_path(path))
|
285
|
+
|
286
|
+
if path.exist? && !fs_case_sensitive?
|
287
|
+
# If the path contains a Windows short path, then we attempt to
|
288
|
+
# expand. The require below is embedded here since it requires
|
289
|
+
# windows to work.
|
290
|
+
if windows? && path.to_s =~ /~\d(\/|\\)/
|
291
|
+
require_relative "windows_path"
|
292
|
+
path = Pathname.new(WindowsPath.longname(path.to_s))
|
293
|
+
end
|
294
|
+
|
295
|
+
# Build up all the parts of the path
|
296
|
+
original = []
|
297
|
+
while !path.root?
|
298
|
+
original.unshift(path.basename.to_s)
|
299
|
+
path = path.parent
|
300
|
+
end
|
301
|
+
|
302
|
+
# Traverse each part and join it into the resulting path
|
303
|
+
original.each do |single|
|
304
|
+
Dir.entries(path).each do |entry|
|
305
|
+
begin
|
306
|
+
single = single.encode("filesystem").to_s
|
307
|
+
rescue ArgumentError => err
|
308
|
+
Vagrant.global_logger.warn("path encoding failed - part=#{single} err=#{err.class} msg=#{err}")
|
309
|
+
# NOTE: Depending on the Windows environment the above
|
310
|
+
# encode will generate an "input string invalid" when
|
311
|
+
# attempting to encode. If that happens, continue on
|
312
|
+
end
|
313
|
+
if entry.downcase == single.downcase
|
314
|
+
path = path.join(entry)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
if windows?
|
321
|
+
# Fix the drive letter to be uppercase.
|
322
|
+
path = path.to_s
|
323
|
+
if path[1] == ":"
|
324
|
+
path[0] = path[0].upcase
|
325
|
+
end
|
326
|
+
|
327
|
+
path = Pathname.new(path)
|
328
|
+
end
|
329
|
+
|
330
|
+
path
|
331
|
+
end
|
332
|
+
|
333
|
+
# Converts a given path to UNC format by adding a prefix and converting slashes.
|
334
|
+
# @param [String] path Path to convert to UNC for Windows
|
335
|
+
# @return [String]
|
336
|
+
def windows_unc_path(path)
|
337
|
+
path = path.gsub("/", "\\")
|
338
|
+
|
339
|
+
# Convert to UNC path
|
340
|
+
if path =~ /^[a-zA-Z]:\\?$/
|
341
|
+
# If the path is just a drive letter, then return that as-is
|
342
|
+
path + "\\"
|
343
|
+
elsif path.start_with?("\\\\")
|
344
|
+
# If the path already starts with `\\` assume UNC and return as-is
|
345
|
+
path
|
346
|
+
else
|
347
|
+
"\\\\?\\" + path.gsub("/", "\\")
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
351
|
+
# Returns a boolean noting whether the terminal supports color.
|
352
|
+
# output.
|
353
|
+
def terminal_supports_colors?
|
354
|
+
return @_terminal_supports_colors if defined?(@_terminal_supports_colors)
|
355
|
+
@_terminal_supports_colors = -> {
|
356
|
+
if windows?
|
357
|
+
return true if ENV.key?("ANSICON")
|
358
|
+
return true if cygwin?
|
359
|
+
return true if ENV["TERM"] == "cygwin"
|
360
|
+
return false
|
361
|
+
end
|
362
|
+
|
363
|
+
return true
|
364
|
+
}.call
|
365
|
+
return @_terminal_supports_colors
|
366
|
+
end
|
367
|
+
|
368
|
+
def platform
|
369
|
+
return @_platform if defined?(@_platform)
|
370
|
+
@_platform = RbConfig::CONFIG["host_os"].downcase
|
371
|
+
return @_platform
|
372
|
+
end
|
373
|
+
|
374
|
+
# Determine if given path is within the WSL rootfs. Returns
|
375
|
+
# true if within the subsystem, or false if outside the subsystem.
|
376
|
+
#
|
377
|
+
# @param [String] path Path to check
|
378
|
+
# @return [Boolean] path is within subsystem
|
379
|
+
def wsl_path?(path)
|
380
|
+
wsl? && !path.to_s.downcase.start_with?("/mnt/")
|
381
|
+
end
|
382
|
+
|
383
|
+
# Compute the path to rootfs of currently active WSL.
|
384
|
+
#
|
385
|
+
# @return [String] A path to rootfs of a current WSL instance.
|
386
|
+
def wsl_rootfs
|
387
|
+
return @_wsl_rootfs if defined?(@_wsl_rootfs)
|
388
|
+
|
389
|
+
if wsl?
|
390
|
+
# Mark our filesystem with a temporary file having an unique name.
|
391
|
+
marker = Tempfile.new(Time.now.to_i.to_s)
|
392
|
+
logger = Log4r::Logger.new("vagrant::util::platform::wsl")
|
393
|
+
|
394
|
+
# Check for lxrun installation first
|
395
|
+
lxrun_path = [wsl_windows_appdata_local, "lxss"].join("\\")
|
396
|
+
paths = [lxrun_path]
|
397
|
+
|
398
|
+
logger.debug("checking registry for WSL installation path")
|
399
|
+
paths += PowerShell.execute_cmd(
|
400
|
+
'(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss ' \
|
401
|
+
'| ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').to_s.split("\r\n").map(&:strip)
|
402
|
+
paths.delete_if{|path| path.to_s.empty?}
|
403
|
+
|
404
|
+
paths.each do |path|
|
405
|
+
# Lowercase the drive letter, skip the next symbol (which is a
|
406
|
+
# colon from a Windows path) and convert path to UNIX style.
|
407
|
+
check_path = "/mnt/#{path[0, 1].downcase}#{path[2..-1].tr('\\', '/')}/rootfs"
|
408
|
+
begin
|
409
|
+
process = Subprocess.execute("wslpath", "-u", "-a", path)
|
410
|
+
check_path = "#{process.stdout.chomp}/rootfs" if process.exit_code == 0
|
411
|
+
rescue Errors::CommandUnavailable => e
|
412
|
+
# pass
|
413
|
+
end
|
414
|
+
|
415
|
+
logger.debug("checking `#{path}` for current WSL instance")
|
416
|
+
begin
|
417
|
+
# https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support
|
418
|
+
# Current WSL instance doesn't have an access to its mount from
|
419
|
+
# within itself despite all others are available. That's the
|
420
|
+
# hacky way we're using to determine current instance.
|
421
|
+
# For example we have three WSL instances:
|
422
|
+
# A -> C:\User\USER\AppData\Local\Packages\A\LocalState\rootfs
|
423
|
+
# B -> C:\User\USER\AppData\Local\Packages\B\LocalState\rootfs
|
424
|
+
# C -> C:\User\USER\AppData\Local\Packages\C\LocalState\rootfs
|
425
|
+
# If we're in "A" WSL at the moment, then its path will not be
|
426
|
+
# accessible since it's mounted for exactly the instance we're
|
427
|
+
# in. All others can be opened.
|
428
|
+
Dir.open(check_path) do |fs|
|
429
|
+
# A fallback for a case if our trick will stop working. For
|
430
|
+
# that we've created a temporary file with an unique name in
|
431
|
+
# a current WSL and now seeking it among all WSL.
|
432
|
+
if File.exist?("#{fs.path}/#{marker.path}")
|
433
|
+
@_wsl_rootfs = path
|
434
|
+
break
|
435
|
+
end
|
436
|
+
end
|
437
|
+
rescue Errno::EACCES
|
438
|
+
@_wsl_rootfs = path
|
439
|
+
# You can create and simultaneously run multiple WSL instances,
|
440
|
+
# comment out the "break", run this script within each one and
|
441
|
+
# it'll return only single value.
|
442
|
+
break
|
443
|
+
rescue Errno::ENOENT
|
444
|
+
# Warn about data discrepancy between Winreg and file system
|
445
|
+
# states. For the sake of justice, it's worth mentioning that
|
446
|
+
# it is possible only when someone will manually break WSL by
|
447
|
+
# removing a directory of its base path (kinda "stupid WSL
|
448
|
+
# uninstallation by removing hidden and system directory").
|
449
|
+
logger.warn("WSL instance at `#{path} is broken or no longer exists")
|
450
|
+
end
|
451
|
+
# All other exceptions have to be raised since they will mean
|
452
|
+
# something unpredictably terrible.
|
453
|
+
end
|
454
|
+
|
455
|
+
marker.close!
|
456
|
+
|
457
|
+
raise Vagrant::Errors::WSLRootFsNotFoundError if @_wsl_rootfs.nil?
|
458
|
+
end
|
459
|
+
|
460
|
+
# Attach the rootfs leaf to the path
|
461
|
+
if @_wsl_rootfs != lxrun_path
|
462
|
+
@_wsl_rootfs = "#{@_wsl_rootfs}\\rootfs"
|
463
|
+
end
|
464
|
+
|
465
|
+
logger.debug("detected `#{@_wsl_rootfs}` as current WSL instance")
|
466
|
+
|
467
|
+
@_wsl_rootfs
|
468
|
+
end
|
469
|
+
|
470
|
+
# Convert a WSL path to the local Windows path. This is useful
|
471
|
+
# for conversion when calling out to Windows executables from
|
472
|
+
# the WSL
|
473
|
+
#
|
474
|
+
# @param [String, Pathname] path Path to convert
|
475
|
+
# @return [String]
|
476
|
+
def wsl_to_windows_path(path)
|
477
|
+
path = path.to_s
|
478
|
+
if wsl? && wsl_windows_access? && !path.match(/^[a-zA-Z]:/)
|
479
|
+
path = File.expand_path(path)
|
480
|
+
begin
|
481
|
+
process = Subprocess.execute("wslpath", "-w", "-a", path)
|
482
|
+
return process.stdout.chomp if process.exit_code == 0
|
483
|
+
rescue Errors::CommandUnavailable => e
|
484
|
+
# pass
|
485
|
+
end
|
486
|
+
if wsl_path?(path)
|
487
|
+
parts = path.split("/")
|
488
|
+
parts.delete_if(&:empty?)
|
489
|
+
root_path = wsl_rootfs
|
490
|
+
# lxrun splits home separate so we need to account
|
491
|
+
# for it's specialness here when we build the path
|
492
|
+
if root_path.end_with?("lxss") && !(["root", "home"].include?(parts.first))
|
493
|
+
root_path = "#{root_path}\\rootfs"
|
494
|
+
end
|
495
|
+
path = [root_path, *parts].join("\\")
|
496
|
+
else
|
497
|
+
path = path.sub("/mnt/", "")
|
498
|
+
parts = path.split("/")
|
499
|
+
parts.first << ":"
|
500
|
+
path = parts.join("\\")
|
501
|
+
end
|
502
|
+
end
|
503
|
+
path
|
504
|
+
end
|
505
|
+
|
506
|
+
# Takes a windows path and formats it to the
|
507
|
+
# 'unix' style (i.e. `/cygdrive/c` or `/c/`)
|
508
|
+
#
|
509
|
+
# @param [Pathname, String] path Path to convert
|
510
|
+
# @param [Hash] hash of arguments
|
511
|
+
# @return [String]
|
512
|
+
def format_windows_path(path, *args)
|
513
|
+
path = cygwin_path(path) if cygwin?
|
514
|
+
path = msys_path(path) if msys?
|
515
|
+
path = wsl_to_windows_path(path) if wsl?
|
516
|
+
if windows? || wsl?
|
517
|
+
path = windows_unc_path(path) if !args.include?(:disable_unc)
|
518
|
+
end
|
519
|
+
|
520
|
+
path
|
521
|
+
end
|
522
|
+
|
523
|
+
# Automatically convert a given path to a Windows path. Will only
|
524
|
+
# be applied if running on a Windows host. If running on Windows
|
525
|
+
# host within the WSL, the actual Windows path will be returned.
|
526
|
+
#
|
527
|
+
# @param [Pathname, String] path Path to convert
|
528
|
+
# @return [String]
|
529
|
+
def windows_path(path)
|
530
|
+
path = cygwin_windows_path(path)
|
531
|
+
path = wsl_to_windows_path(path)
|
532
|
+
if windows? || wsl?
|
533
|
+
path = windows_unc_path(path)
|
534
|
+
end
|
535
|
+
path
|
536
|
+
end
|
537
|
+
|
538
|
+
# Allow Vagrant to access Vagrant managed machines outside the
|
539
|
+
# Windows Subsystem for Linux
|
540
|
+
#
|
541
|
+
# @return [Boolean]
|
542
|
+
def wsl_windows_access?
|
543
|
+
if !defined?(@_wsl_windows_access)
|
544
|
+
@_wsl_windows_access = wsl? && ENV["VAGRANT_WSL_ENABLE_WINDOWS_ACCESS"]
|
545
|
+
end
|
546
|
+
@_wsl_windows_access
|
547
|
+
end
|
548
|
+
|
549
|
+
# The allowed windows system path Vagrant can manage from the Windows
|
550
|
+
# Subsystem for Linux
|
551
|
+
#
|
552
|
+
# @return [Pathname]
|
553
|
+
def wsl_windows_accessible_path
|
554
|
+
if !defined?(@_wsl_windows_accessible_path)
|
555
|
+
access_path = ENV["VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH"]
|
556
|
+
if access_path.to_s.empty?
|
557
|
+
begin
|
558
|
+
process = Subprocess.execute("wslpath", "-u", "-a", wsl_windows_home)
|
559
|
+
access_path = process.stdout.chomp if process.exit_code == 0
|
560
|
+
rescue Errors::CommandUnavailable => e
|
561
|
+
# pass
|
562
|
+
end
|
563
|
+
end
|
564
|
+
if access_path.to_s.empty?
|
565
|
+
access_path = wsl_windows_home.gsub("\\", "/").sub(":", "")
|
566
|
+
access_path[0] = access_path[0].downcase
|
567
|
+
access_path = "/mnt/#{access_path}"
|
568
|
+
end
|
569
|
+
@_wsl_windows_accessible_path = Pathname.new(access_path)
|
570
|
+
end
|
571
|
+
@_wsl_windows_accessible_path
|
572
|
+
end
|
573
|
+
|
574
|
+
# Checks given path to determine if Vagrant is allowed to bypass checks
|
575
|
+
#
|
576
|
+
# @param [String] path Path to check
|
577
|
+
# @return [Boolean] Vagrant is allowed to bypass checks
|
578
|
+
def wsl_windows_access_bypass?(path)
|
579
|
+
wsl? && wsl_windows_access? &&
|
580
|
+
path.to_s.start_with?(wsl_windows_accessible_path.to_s)
|
581
|
+
end
|
582
|
+
|
583
|
+
# Mount pattern for extracting local mount information
|
584
|
+
MOUNT_PATTERN = /^(?<device>.+?) on (?<mount>.+?) type (?<type>.+?) \((?<options>.+)\)/.freeze
|
585
|
+
|
586
|
+
# Get list of local mount paths that are DrvFs file systems
|
587
|
+
#
|
588
|
+
# @return [Array<String>]
|
589
|
+
# @todo(chrisroberts): Constantize types for check
|
590
|
+
def wsl_drvfs_mounts
|
591
|
+
if !defined?(@_wsl_drvfs_mounts)
|
592
|
+
@_wsl_drvfs_mounts = []
|
593
|
+
if wsl?
|
594
|
+
result = Util::Subprocess.execute("mount")
|
595
|
+
result.stdout.each_line do |line|
|
596
|
+
info = line.match(MOUNT_PATTERN)
|
597
|
+
if info && (info[:type] == "drvfs" || info[:type] == "9p")
|
598
|
+
@_wsl_drvfs_mounts << info[:mount]
|
599
|
+
end
|
600
|
+
end
|
601
|
+
end
|
602
|
+
end
|
603
|
+
@_wsl_drvfs_mounts
|
604
|
+
end
|
605
|
+
|
606
|
+
# Check if given path is located on DrvFs file system
|
607
|
+
#
|
608
|
+
# @param [String, Pathname] path Path to check
|
609
|
+
# @return [Boolean]
|
610
|
+
def wsl_drvfs_path?(path)
|
611
|
+
if wsl?
|
612
|
+
wsl_drvfs_mounts.each do |mount_path|
|
613
|
+
return true if path.to_s.start_with?(mount_path)
|
614
|
+
end
|
615
|
+
end
|
616
|
+
false
|
617
|
+
end
|
618
|
+
|
619
|
+
# If running within the Windows Subsystem for Linux, this will provide
|
620
|
+
# simple setup to allow sharing of the user's VAGRANT_HOME directory
|
621
|
+
# within the subsystem
|
622
|
+
#
|
623
|
+
# @param [Environment] env
|
624
|
+
# @param [Logger] logger Optional logger to display information
|
625
|
+
def wsl_init(env, logger=nil)
|
626
|
+
if wsl?
|
627
|
+
if ENV["VAGRANT_WSL_ENABLE_WINDOWS_ACCESS"]
|
628
|
+
wsl_validate_matching_vagrant_versions!
|
629
|
+
shared_user = ENV["VAGRANT_WSL_WINDOWS_ACCESS_USER"]
|
630
|
+
if shared_user.to_s.empty?
|
631
|
+
shared_user = wsl_windows_username
|
632
|
+
end
|
633
|
+
if logger
|
634
|
+
logger.warn("Windows Subsystem for Linux detected. Allowing access to user: #{shared_user}")
|
635
|
+
logger.warn("Vagrant will be allowed to control Vagrant managed machines within the user's home path.")
|
636
|
+
end
|
637
|
+
if ENV["VAGRANT_HOME"] || ENV["VAGRANT_WSL_DISABLE_VAGRANT_HOME"]
|
638
|
+
logger.warn("VAGRANT_HOME environment variable already set. Not overriding!") if logger
|
639
|
+
else
|
640
|
+
home_path = wsl_windows_accessible_path.to_s
|
641
|
+
ENV["VAGRANT_HOME"] = File.join(home_path, ".vagrant.d")
|
642
|
+
if logger
|
643
|
+
logger.info("Overriding VAGRANT_HOME environment variable to configured windows user. (#{ENV["VAGRANT_HOME"]})")
|
644
|
+
end
|
645
|
+
true
|
646
|
+
end
|
647
|
+
else
|
648
|
+
if env.local_data_path.to_s.start_with?("/mnt/")
|
649
|
+
raise Vagrant::Errors::WSLVagrantAccessError
|
650
|
+
end
|
651
|
+
end
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
# Fetch the Windows username currently in use
|
656
|
+
#
|
657
|
+
# @return [String, Nil]
|
658
|
+
def wsl_windows_username
|
659
|
+
if !@_wsl_windows_username
|
660
|
+
result = Util::Subprocess.execute("cmd.exe", "/c", "echo %USERNAME%")
|
661
|
+
if result.exit_code == 0
|
662
|
+
@_wsl_windows_username = result.stdout.strip
|
663
|
+
end
|
664
|
+
end
|
665
|
+
@_wsl_windows_username
|
666
|
+
end
|
667
|
+
|
668
|
+
# Fetch the Windows user home directory
|
669
|
+
#
|
670
|
+
# @return [String, Nil]
|
671
|
+
def wsl_windows_home
|
672
|
+
if !@_wsl_windows_home
|
673
|
+
result = Util::Subprocess.execute("cmd.exe", "/c" "echo %USERPROFILE%")
|
674
|
+
if result.exit_code == 0
|
675
|
+
@_wsl_windows_home = result.stdout.gsub("\"", "").strip
|
676
|
+
end
|
677
|
+
end
|
678
|
+
@_wsl_windows_home
|
679
|
+
end
|
680
|
+
|
681
|
+
# Fetch the Windows user local app data directory
|
682
|
+
#
|
683
|
+
# @return [String, Nil]
|
684
|
+
def wsl_windows_appdata_local
|
685
|
+
if !@_wsl_windows_appdata_local
|
686
|
+
result = Util::Subprocess.execute("cmd.exe", "/c", "echo %LOCALAPPDATA%")
|
687
|
+
if result.exit_code == 0
|
688
|
+
@_wsl_windows_appdata_local = result.stdout.gsub("\"", "").strip
|
689
|
+
end
|
690
|
+
end
|
691
|
+
@_wsl_windows_appdata_local
|
692
|
+
end
|
693
|
+
|
694
|
+
# Confirm Vagrant versions installed within the WSL and the Windows system
|
695
|
+
# are the same. Raise error if they do not match.
|
696
|
+
def wsl_validate_matching_vagrant_versions!
|
697
|
+
valid = false
|
698
|
+
if Util::Which.which("vagrant.exe")
|
699
|
+
result = Util::Subprocess.execute("vagrant.exe", "--version")
|
700
|
+
if result.exit_code == 0
|
701
|
+
windows_version = result.stdout.match(/Vagrant (?<version>[\w.-]+)/)
|
702
|
+
if windows_version
|
703
|
+
windows_version = windows_version[:version].strip
|
704
|
+
valid = windows_version == Vagrant::VERSION
|
705
|
+
end
|
706
|
+
end
|
707
|
+
if !valid
|
708
|
+
raise Vagrant::Errors::WSLVagrantVersionMismatch,
|
709
|
+
wsl_version: Vagrant::VERSION,
|
710
|
+
windows_version: windows_version || "unknown"
|
711
|
+
end
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
715
|
+
# systemd is in use
|
716
|
+
def systemd?
|
717
|
+
if !defined?(@_systemd)
|
718
|
+
if !windows?
|
719
|
+
result = Vagrant::Util::Subprocess.execute("ps", "-o", "comm=", "1")
|
720
|
+
@_systemd = result.stdout.chomp == "systemd"
|
721
|
+
else
|
722
|
+
@_systemd = false
|
723
|
+
end
|
724
|
+
end
|
725
|
+
@_systemd
|
726
|
+
end
|
727
|
+
|
728
|
+
# @private
|
729
|
+
# Reset the cached values for platform. This is not considered a public
|
730
|
+
# API and should only be used for testing.
|
731
|
+
def reset!
|
732
|
+
instance_variables.each(&method(:remove_instance_variable))
|
733
|
+
end
|
734
|
+
end
|
735
|
+
end
|
736
|
+
end
|
737
|
+
end
|