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,278 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
require "cgi"
|
5
|
+
require "uri"
|
6
|
+
|
7
|
+
require "log4r"
|
8
|
+
require "digest"
|
9
|
+
require "digest/md5"
|
10
|
+
require "digest/sha1"
|
11
|
+
require "vagrant/util/busy"
|
12
|
+
require "vagrant/util/platform"
|
13
|
+
require "vagrant/util/subprocess"
|
14
|
+
require "vagrant/util/curl_helper"
|
15
|
+
require "vagrant/util/file_checksum"
|
16
|
+
|
17
|
+
module Vagrant
|
18
|
+
module Util
|
19
|
+
# This class downloads files using various protocols by subprocessing
|
20
|
+
# to cURL. cURL is a much more capable and complete download tool than
|
21
|
+
# a hand-rolled Ruby library, so we defer to its expertise.
|
22
|
+
class Downloader
|
23
|
+
# Custom user agent provided to cURL so that requests to URL shorteners
|
24
|
+
# are properly tracked.
|
25
|
+
#
|
26
|
+
# Vagrant/1.7.4 (+https://www.vagrantup.com; ruby2.1.0)
|
27
|
+
USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION}) #{ENV['VAGRANT_USER_AGENT_PROVISIONAL_STRING']}".strip.freeze
|
28
|
+
|
29
|
+
attr_accessor :source
|
30
|
+
attr_reader :destination
|
31
|
+
attr_accessor :headers
|
32
|
+
|
33
|
+
def initialize(source, destination, options=nil)
|
34
|
+
options ||= {}
|
35
|
+
|
36
|
+
@logger = Log4r::Logger.new("vagrant::util::downloader")
|
37
|
+
@source = source.to_s
|
38
|
+
@destination = destination.to_s
|
39
|
+
|
40
|
+
begin
|
41
|
+
url = URI.parse(@source)
|
42
|
+
if url.scheme && url.scheme.start_with?("http") && url.user
|
43
|
+
auth = "#{CGI.unescape(url.user)}"
|
44
|
+
auth += ":#{CGI.unescape(url.password)}" if url.password
|
45
|
+
url.user = nil
|
46
|
+
url.password = nil
|
47
|
+
options[:auth] ||= auth
|
48
|
+
@source = url.to_s
|
49
|
+
end
|
50
|
+
rescue URI::InvalidURIError
|
51
|
+
# Ignore, since its clearly not HTTP
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get the various optional values
|
55
|
+
@auth = options[:auth]
|
56
|
+
@ca_cert = options[:ca_cert]
|
57
|
+
@ca_path = options[:ca_path]
|
58
|
+
@continue = options[:continue]
|
59
|
+
@headers = Array(options[:headers])
|
60
|
+
@insecure = options[:insecure]
|
61
|
+
@ui = options[:ui]
|
62
|
+
@client_cert = options[:client_cert]
|
63
|
+
@location_trusted = options[:location_trusted]
|
64
|
+
@checksums = {
|
65
|
+
:md5 => options[:md5],
|
66
|
+
:sha1 => options[:sha1],
|
67
|
+
:sha256 => options[:sha256],
|
68
|
+
:sha384 => options[:sha384],
|
69
|
+
:sha512 => options[:sha512]
|
70
|
+
}.compact
|
71
|
+
@extra_download_options = options[:box_extra_download_options] || []
|
72
|
+
# If on Windows SSL revocation checks should be best effort. More context
|
73
|
+
# for this usage can be found in the following links:
|
74
|
+
#
|
75
|
+
# https://github.com/curl/curl/issues/3727
|
76
|
+
# https://github.com/curl/curl/pull/4981
|
77
|
+
if Platform.windows?
|
78
|
+
@ssl_revoke_best_effort = !options[:disable_ssl_revoke_best_effort]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# This executes the actual download, downloading the source file
|
83
|
+
# to the destination with the given options used to initialize this
|
84
|
+
# class.
|
85
|
+
#
|
86
|
+
# If this method returns without an exception, the download
|
87
|
+
# succeeded. An exception will be raised if the download failed.
|
88
|
+
def download!
|
89
|
+
# This variable can contain the proc that'll be sent to
|
90
|
+
# the subprocess execute.
|
91
|
+
data_proc = nil
|
92
|
+
|
93
|
+
extra_subprocess_opts = {}
|
94
|
+
if @ui
|
95
|
+
# If we're outputting progress, then setup the subprocess to
|
96
|
+
# tell us output so we can parse it out.
|
97
|
+
extra_subprocess_opts[:notify] = :stderr
|
98
|
+
|
99
|
+
data_proc = Vagrant::Util::CurlHelper.capture_output_proc(@logger, @ui, @source)
|
100
|
+
end
|
101
|
+
|
102
|
+
@logger.info("Downloader starting download: ")
|
103
|
+
@logger.info(" -- Source: #{@source}")
|
104
|
+
@logger.info(" -- Destination: #{@destination}")
|
105
|
+
|
106
|
+
retried = false
|
107
|
+
begin
|
108
|
+
# Get the command line args and the subprocess opts based
|
109
|
+
# on our downloader settings.
|
110
|
+
options, subprocess_options = self.options
|
111
|
+
options += ["--output", @destination]
|
112
|
+
options << @source
|
113
|
+
|
114
|
+
# Merge in any extra options we set
|
115
|
+
subprocess_options.merge!(extra_subprocess_opts)
|
116
|
+
|
117
|
+
# Go!
|
118
|
+
execute_curl(options, subprocess_options, &data_proc)
|
119
|
+
rescue Errors::DownloaderError => e
|
120
|
+
# If we already retried, raise it.
|
121
|
+
raise if retried
|
122
|
+
|
123
|
+
@logger.error("Exit code: #{e.extra_data[:code]}")
|
124
|
+
|
125
|
+
# If its any error other than 33, it is an error.
|
126
|
+
raise if e.extra_data[:code].to_i != 33
|
127
|
+
|
128
|
+
# Exit code 33 means that the server doesn't support ranges.
|
129
|
+
# In this case, try again without resume.
|
130
|
+
@logger.error("Error is server doesn't support byte ranges. Retrying from scratch.")
|
131
|
+
@continue = false
|
132
|
+
retried = true
|
133
|
+
retry
|
134
|
+
ensure
|
135
|
+
# If we're outputting to the UI, clear the output to
|
136
|
+
# avoid lingering progress meters.
|
137
|
+
if @ui
|
138
|
+
@ui.clear_line
|
139
|
+
|
140
|
+
# Windows doesn't clear properly for some reason, so we just
|
141
|
+
# output one more newline.
|
142
|
+
@ui.detail("") if Platform.windows?
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
validate_download!(@source, @destination, @checksums)
|
147
|
+
|
148
|
+
# Everything succeeded
|
149
|
+
true
|
150
|
+
end
|
151
|
+
|
152
|
+
# Does a HEAD request of the URL and returns the output.
|
153
|
+
def head
|
154
|
+
options, subprocess_options = self.options
|
155
|
+
options.unshift("-I")
|
156
|
+
options << @source
|
157
|
+
|
158
|
+
@logger.info("HEAD: #{@source}")
|
159
|
+
result = execute_curl(options, subprocess_options)
|
160
|
+
result.stdout
|
161
|
+
end
|
162
|
+
|
163
|
+
protected
|
164
|
+
|
165
|
+
# Apply any checksum validations based on provided
|
166
|
+
# options content
|
167
|
+
#
|
168
|
+
# @param source [String] Source of file
|
169
|
+
# @param path [String, Pathname] local file path
|
170
|
+
# @param checksums [Hash] User provided options
|
171
|
+
# @option checksums [String] :md5 Compare MD5 checksum
|
172
|
+
# @option checksums [String] :sha1 Compare SHA1 checksum
|
173
|
+
# @return [Boolean]
|
174
|
+
def validate_download!(source, path, checksums)
|
175
|
+
checksums.each do |type, expected|
|
176
|
+
actual = FileChecksum.new(path, type).checksum
|
177
|
+
@logger.debug("Validating checksum (#{type}) for #{source}. " \
|
178
|
+
"expected: #{expected} actual: #{actual}")
|
179
|
+
if actual.casecmp(expected) != 0
|
180
|
+
raise Errors::DownloaderChecksumError.new(
|
181
|
+
source: source,
|
182
|
+
path: path,
|
183
|
+
type: type,
|
184
|
+
expected_checksum: expected,
|
185
|
+
actual_checksum: actual
|
186
|
+
)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
true
|
190
|
+
end
|
191
|
+
|
192
|
+
def execute_curl(options, subprocess_options, &data_proc)
|
193
|
+
options = options.dup
|
194
|
+
options.unshift("-q")
|
195
|
+
options << subprocess_options
|
196
|
+
|
197
|
+
# Create the callback that is called if we are interrupted
|
198
|
+
interrupted = false
|
199
|
+
int_callback = Proc.new do
|
200
|
+
@logger.info("Downloader interrupted!")
|
201
|
+
interrupted = true
|
202
|
+
end
|
203
|
+
|
204
|
+
# Execute!
|
205
|
+
result = Busy.busy(int_callback) do
|
206
|
+
Subprocess.execute("curl", *options, &data_proc)
|
207
|
+
end
|
208
|
+
|
209
|
+
# If the download was interrupted, then raise a specific error
|
210
|
+
raise Errors::DownloaderInterrupted if interrupted
|
211
|
+
|
212
|
+
# If it didn't exit successfully, we need to parse the data and
|
213
|
+
# show an error message.
|
214
|
+
if result.exit_code != 0
|
215
|
+
@logger.warn("Downloader exit code: #{result.exit_code}")
|
216
|
+
check = result.stderr.match(/\n*curl:\s+\((?<code>\d+)\)\s*(?<error>.*)$/)
|
217
|
+
if check && check[:code] == "416"
|
218
|
+
# All good actually. 416 means there is no more bytes to download
|
219
|
+
@logger.warn("Downloader got a 416, but is likely fine. Continuing on...")
|
220
|
+
else
|
221
|
+
if !check
|
222
|
+
err_msg = result.stderr
|
223
|
+
else
|
224
|
+
err_msg = check[:error]
|
225
|
+
end
|
226
|
+
|
227
|
+
raise Errors::DownloaderError,
|
228
|
+
code: result.exit_code,
|
229
|
+
message: err_msg
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
result
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the various cURL and subprocess options.
|
237
|
+
#
|
238
|
+
# @return [Array<Array, Hash>]
|
239
|
+
def options
|
240
|
+
# Build the list of parameters to execute with cURL
|
241
|
+
options = [
|
242
|
+
"--fail",
|
243
|
+
"--location",
|
244
|
+
"--max-redirs", "10", "--verbose",
|
245
|
+
"--user-agent", USER_AGENT,
|
246
|
+
]
|
247
|
+
|
248
|
+
options += ["--cacert", @ca_cert] if @ca_cert
|
249
|
+
options += ["--capath", @ca_path] if @ca_path
|
250
|
+
options += ["--continue-at", "-"] if @continue
|
251
|
+
options << "--insecure" if @insecure
|
252
|
+
options << "--cert" << @client_cert if @client_cert
|
253
|
+
options << "-u" << @auth if @auth
|
254
|
+
options << "--location-trusted" if @location_trusted
|
255
|
+
options << "--ssl-revoke-best-effort" if @ssl_revoke_best_effort
|
256
|
+
|
257
|
+
options.concat(@extra_download_options)
|
258
|
+
|
259
|
+
if @headers
|
260
|
+
Array(@headers).each do |header|
|
261
|
+
options << "-H" << header
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# Specify some options for the subprocess
|
266
|
+
subprocess_options = {}
|
267
|
+
|
268
|
+
# If we're in Vagrant, then we use the packaged CA bundle
|
269
|
+
if Vagrant.in_installer?
|
270
|
+
subprocess_options[:env] ||= {}
|
271
|
+
subprocess_options[:env]["CURL_CA_BUNDLE"] = ENV["CURL_CA_BUNDLE"]
|
272
|
+
end
|
273
|
+
|
274
|
+
return [options, subprocess_options]
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module Util
|
6
|
+
class Env
|
7
|
+
def self.with_original_env
|
8
|
+
original_env = ENV.to_hash
|
9
|
+
if defined?(::Bundler) && defined?(::Bundler::ORIGINAL_ENV)
|
10
|
+
ENV.replace(::Bundler::ORIGINAL_ENV)
|
11
|
+
end
|
12
|
+
ENV.update(Vagrant.original_env)
|
13
|
+
yield
|
14
|
+
ensure
|
15
|
+
ENV.replace(original_env.to_hash)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Execute the given command, removing any Ruby-specific environment
|
19
|
+
# variables. This is an "enhanced" version of `Bundler.with_clean_env`,
|
20
|
+
# which only removes Bundler-specific values. We need to remove all
|
21
|
+
# values, specifically:
|
22
|
+
#
|
23
|
+
# - _ORIGINAL_GEM_PATH
|
24
|
+
# - GEM_PATH
|
25
|
+
# - GEM_HOME
|
26
|
+
# - GEM_ROOT
|
27
|
+
# - BUNDLE_BIN_PATH
|
28
|
+
# - BUNDLE_GEMFILE
|
29
|
+
# - RUBYLIB
|
30
|
+
# - RUBYOPT
|
31
|
+
# - RUBY_ENGINE
|
32
|
+
# - RUBY_ROOT
|
33
|
+
# - RUBY_VERSION
|
34
|
+
#
|
35
|
+
# This will escape Vagrant's environment entirely, which is required if
|
36
|
+
# calling an executable that lives in another Ruby environment. The
|
37
|
+
# original environment restored at the end of this call.
|
38
|
+
#
|
39
|
+
# @param [Proc] block
|
40
|
+
# the block to execute with the cleaned environment
|
41
|
+
def self.with_clean_env
|
42
|
+
with_original_env do
|
43
|
+
if ENV["BUNDLE_ORIG_MANPATH"]
|
44
|
+
ENV["MANPATH"] = ENV["BUNDLE_ORIG_MANPATH"]
|
45
|
+
end
|
46
|
+
ENV.delete_if { |k,_| k[0,7] == "BUNDLE_" }
|
47
|
+
if ENV.has_key? "RUBYOPT"
|
48
|
+
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub("-rbundler/setup", "")
|
49
|
+
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub("-I#{File.expand_path('..', __FILE__)}", "")
|
50
|
+
end
|
51
|
+
yield
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module Util
|
6
|
+
class Experimental
|
7
|
+
class << self
|
8
|
+
# A method for determining if the experimental flag has been enabled with
|
9
|
+
# any features
|
10
|
+
#
|
11
|
+
# @return [Boolean]
|
12
|
+
def enabled?
|
13
|
+
if !defined?(@_experimental)
|
14
|
+
experimental = features_requested
|
15
|
+
if experimental.size >= 1 && experimental.first != "0"
|
16
|
+
@_experimental = true
|
17
|
+
else
|
18
|
+
@_experimental = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
@_experimental
|
22
|
+
end
|
23
|
+
|
24
|
+
# A method for determining if all experimental features have been enabled
|
25
|
+
# by either a global enabled value "1" or all features explicitly enabled.
|
26
|
+
#
|
27
|
+
# @return [Boolean]
|
28
|
+
def global_enabled?
|
29
|
+
if !defined?(@_global_enabled)
|
30
|
+
experimental = features_requested
|
31
|
+
if experimental.size == 1 && experimental.first == "1"
|
32
|
+
@_global_enabled = true
|
33
|
+
else
|
34
|
+
@_global_enabled = false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
@_global_enabled
|
38
|
+
end
|
39
|
+
|
40
|
+
# A method for Vagrant internals to determine if a given feature
|
41
|
+
# has been abled by the user, is a valid feature flag and can be used.
|
42
|
+
#
|
43
|
+
# @param [String] feature
|
44
|
+
# @return [Boolean] - A hash containing the original array and if it is valid
|
45
|
+
def feature_enabled?(feature)
|
46
|
+
experimental = features_requested
|
47
|
+
feature = feature.to_s
|
48
|
+
|
49
|
+
return global_enabled? || experimental.include?(feature)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns the features requested for the experimental flag
|
53
|
+
#
|
54
|
+
# @return [Array] - Returns an array of requested experimental features
|
55
|
+
def features_requested
|
56
|
+
if !defined?(@_requested_features)
|
57
|
+
@_requested_features = ENV["VAGRANT_EXPERIMENTAL"].to_s.downcase.split(',')
|
58
|
+
end
|
59
|
+
@_requested_features
|
60
|
+
end
|
61
|
+
|
62
|
+
# A function to guard experimental blocks of code from being executed
|
63
|
+
#
|
64
|
+
# @param [Array] features - Array of features to guard a method with
|
65
|
+
# @param [Block] block - Block of ruby code to be guarded against
|
66
|
+
def guard_with(*features, &block)
|
67
|
+
yield if block_given? && features.any? {|f| feature_enabled?(f)}
|
68
|
+
end
|
69
|
+
|
70
|
+
# @private
|
71
|
+
# Reset the cached values for platform. This is not considered a public
|
72
|
+
# API and should only be used for testing.
|
73
|
+
def reset!
|
74
|
+
instance_variables.each(&method(:remove_instance_variable))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
# This is an "interface" that should be implemented by any digest class
|
5
|
+
# passed into FileChecksum. Note that this isn't strictly enforced at
|
6
|
+
# the moment, and this class isn't directly used. It is merely here for
|
7
|
+
# documentation of structure of the class.
|
8
|
+
|
9
|
+
require "vagrant/errors"
|
10
|
+
|
11
|
+
class DigestClass
|
12
|
+
def update(string); end
|
13
|
+
def hexdigest; end
|
14
|
+
end
|
15
|
+
|
16
|
+
class FileChecksum
|
17
|
+
BUFFER_SIZE = 1024 * 8
|
18
|
+
|
19
|
+
# Supported file checksum
|
20
|
+
CHECKSUM_MAP = {
|
21
|
+
:md5 => Digest::MD5,
|
22
|
+
:sha1 => Digest::SHA1,
|
23
|
+
:sha256 => Digest::SHA256,
|
24
|
+
:sha384 => Digest::SHA384,
|
25
|
+
:sha512 => Digest::SHA512
|
26
|
+
}.freeze
|
27
|
+
|
28
|
+
# Initializes an object to calculate the checksum of a file. The given
|
29
|
+
# ``digest_klass`` should implement the ``DigestClass`` interface. Note
|
30
|
+
# that the built-in Ruby digest classes duck type this properly:
|
31
|
+
# Digest::MD5, Digest::SHA1, etc.
|
32
|
+
def initialize(path, digest_klass)
|
33
|
+
if digest_klass.is_a?(Class)
|
34
|
+
@digest_klass = digest_klass
|
35
|
+
else
|
36
|
+
@digest_klass = load_digest(digest_klass)
|
37
|
+
end
|
38
|
+
|
39
|
+
@path = path
|
40
|
+
end
|
41
|
+
|
42
|
+
# This calculates the checksum of the file and returns it as a
|
43
|
+
# string.
|
44
|
+
#
|
45
|
+
# @return [String]
|
46
|
+
def checksum
|
47
|
+
digest = @digest_klass.new
|
48
|
+
buf = ''
|
49
|
+
|
50
|
+
File.open(@path, "rb") do |f|
|
51
|
+
while !f.eof
|
52
|
+
begin
|
53
|
+
f.readpartial(BUFFER_SIZE, buf)
|
54
|
+
digest.update(buf)
|
55
|
+
rescue EOFError
|
56
|
+
# Although we check for EOF earlier, this seems to happen
|
57
|
+
# sometimes anyways [GH-2716].
|
58
|
+
break
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
digest.hexdigest
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def load_digest(type)
|
69
|
+
digest = CHECKSUM_MAP[type.to_s.downcase.to_sym]
|
70
|
+
if digest.nil?
|
71
|
+
raise Vagrant::Errors::BoxChecksumInvalidType,
|
72
|
+
type: type.to_s,
|
73
|
+
types: CHECKSUM_MAP.keys.join(', ')
|
74
|
+
end
|
75
|
+
digest
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module Util
|
6
|
+
class FileMode
|
7
|
+
# This returns the file permissions as a string from
|
8
|
+
# an octal number.
|
9
|
+
def self.from_octal(octal)
|
10
|
+
perms = sprintf("%o", octal)
|
11
|
+
perms.reverse[0..2].reverse
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module Util
|
6
|
+
# Utility to provide a simple mutex via file lock
|
7
|
+
class FileMutex
|
8
|
+
# Create a new FileMutex instance
|
9
|
+
#
|
10
|
+
# @param mutex_path [String] path for file
|
11
|
+
def initialize(mutex_path)
|
12
|
+
@mutex_path = mutex_path
|
13
|
+
end
|
14
|
+
|
15
|
+
# Execute provided block within lock and unlock
|
16
|
+
# when completed
|
17
|
+
def with_lock(&block)
|
18
|
+
lock
|
19
|
+
begin
|
20
|
+
block.call
|
21
|
+
rescue => e
|
22
|
+
raise e
|
23
|
+
ensure
|
24
|
+
unlock
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attempt to acquire the lock
|
29
|
+
def lock
|
30
|
+
if lock_file.flock(File::LOCK_EX|File::LOCK_NB) === false
|
31
|
+
raise Errors::VagrantLocked, lock_file_path: @mutex_path
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Unlock the file
|
36
|
+
def unlock
|
37
|
+
lock_file.flock(File::LOCK_UN)
|
38
|
+
lock_file.close
|
39
|
+
File.delete(@mutex_path) if File.file?(@mutex_path)
|
40
|
+
end
|
41
|
+
|
42
|
+
protected
|
43
|
+
|
44
|
+
def lock_file
|
45
|
+
return @lock_file if @lock_file && !@lock_file.closed?
|
46
|
+
@lock_file = File.open(@mutex_path, "w+")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Copyright (c) HashiCorp, Inc.
|
2
|
+
# SPDX-License-Identifier: BUSL-1.1
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module Util
|
6
|
+
# Helper methods for modfiying guests /etc/hosts file
|
7
|
+
module GuestHosts
|
8
|
+
|
9
|
+
module Unix
|
10
|
+
DEAFAULT_LOOPBACK_CHECK_LIMIT = 5.freeze
|
11
|
+
|
12
|
+
# Add hostname to a loopback address on /etc/hosts if not already there
|
13
|
+
# Will insert name at the first free address of the form 127.0.X.1, up to
|
14
|
+
# the loop_bound
|
15
|
+
#
|
16
|
+
# @param [Communicator]
|
17
|
+
# @param [String] full hostanme
|
18
|
+
# @param [int] (option) defines the upper bound for searching for an available loopback address
|
19
|
+
def add_hostname_to_loopback_interface(comm, name, loop_bound=DEAFAULT_LOOPBACK_CHECK_LIMIT)
|
20
|
+
basename = name.split(".", 2)[0]
|
21
|
+
comm.sudo <<-EOH.gsub(/^ {14}/, '')
|
22
|
+
grep -w '#{name}' /etc/hosts || {
|
23
|
+
for i in #{[*1..loop_bound].join(' ')}; do
|
24
|
+
grep -w "127.0.${i}.1" /etc/hosts || {
|
25
|
+
echo "127.0.${i}.1 #{name} #{basename}" >> /etc/hosts
|
26
|
+
break
|
27
|
+
}
|
28
|
+
done
|
29
|
+
}
|
30
|
+
EOH
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Linux specific inspection helpers
|
35
|
+
module Linux
|
36
|
+
include Unix
|
37
|
+
# Remove any line in /etc/hosts that contains hostname,
|
38
|
+
# then add hostname with associated ip
|
39
|
+
#
|
40
|
+
# @param [Communicator]
|
41
|
+
# @param [String] full hostanme
|
42
|
+
# @param [String] target ip
|
43
|
+
def replace_host(comm, name, ip)
|
44
|
+
basename = name.split(".", 2)[0]
|
45
|
+
comm.sudo <<-EOH.gsub(/^ {14}/, '')
|
46
|
+
sed -i '/#{name}/d' /etc/hosts
|
47
|
+
sed -i'' '1i '#{ip}'\\t#{name}\\t#{basename}' /etc/hosts
|
48
|
+
EOH
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# BSD specific inspection helpers
|
53
|
+
module BSD
|
54
|
+
include Unix
|
55
|
+
# Remove any line in /etc/hosts that contains hostname,
|
56
|
+
# then add hostname with associated ip
|
57
|
+
#
|
58
|
+
# @param [Communicator]
|
59
|
+
# @param [String] full hostanme
|
60
|
+
# @param [String] target ip
|
61
|
+
def replace_host(comm, name, ip)
|
62
|
+
basename = name.split(".", 2)[0]
|
63
|
+
comm.sudo <<-EOH.gsub(/^ {14}/, '')
|
64
|
+
sed -i.bak '/#{name}/d' /etc/hosts
|
65
|
+
sed -i.bak '1i\\\n#{ip}\t#{name}\t#{basename}\n' /etc/hosts
|
66
|
+
EOH
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|