tnargav 1.2.2
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.
- data/.gitignore +31 -0
- data/.gitsetup.yml +5 -0
- data/.travis.yml +7 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +1067 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +89 -0
- data/Rakefile +18 -0
- data/bin/vagrant +106 -0
- data/config/default.rb +36 -0
- data/contrib/README.md +12 -0
- data/contrib/bash/completion.sh +3 -0
- data/contrib/emacs/vagrant.el +8 -0
- data/contrib/vim/vagrantfile.vim +9 -0
- data/keys/README.md +17 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.pub +1 -0
- data/lib/vagrant/action/builder.rb +174 -0
- data/lib/vagrant/action/builtin/box_add.rb +81 -0
- data/lib/vagrant/action/builtin/call.rb +67 -0
- data/lib/vagrant/action/builtin/config_validate.rb +30 -0
- data/lib/vagrant/action/builtin/confirm.rb +38 -0
- data/lib/vagrant/action/builtin/destroy_confirm.rb +21 -0
- data/lib/vagrant/action/builtin/env_set.rb +24 -0
- data/lib/vagrant/action/builtin/graceful_halt.rb +73 -0
- data/lib/vagrant/action/builtin/handle_box_url.rb +77 -0
- data/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +134 -0
- data/lib/vagrant/action/builtin/lock.rb +57 -0
- data/lib/vagrant/action/builtin/nfs.rb +118 -0
- data/lib/vagrant/action/builtin/provision.rb +70 -0
- data/lib/vagrant/action/builtin/set_hostname.rb +27 -0
- data/lib/vagrant/action/builtin/ssh_exec.rb +42 -0
- data/lib/vagrant/action/builtin/ssh_run.rb +43 -0
- data/lib/vagrant/action/general/package.rb +103 -0
- data/lib/vagrant/action/hook.rb +107 -0
- data/lib/vagrant/action/runner.rb +69 -0
- data/lib/vagrant/action/warden.rb +103 -0
- data/lib/vagrant/action.rb +43 -0
- data/lib/vagrant/batch_action.rb +113 -0
- data/lib/vagrant/box.rb +97 -0
- data/lib/vagrant/box_collection.rb +375 -0
- data/lib/vagrant/cli.rb +82 -0
- data/lib/vagrant/config/loader.rb +222 -0
- data/lib/vagrant/config/v1/dummy_config.rb +13 -0
- data/lib/vagrant/config/v1/loader.rb +105 -0
- data/lib/vagrant/config/v1/root.rb +60 -0
- data/lib/vagrant/config/v1.rb +9 -0
- data/lib/vagrant/config/v2/dummy_config.rb +13 -0
- data/lib/vagrant/config/v2/loader.rb +141 -0
- data/lib/vagrant/config/v2/root.rb +105 -0
- data/lib/vagrant/config/v2/util.rb +21 -0
- data/lib/vagrant/config/v2.rb +9 -0
- data/lib/vagrant/config/version_base.rb +80 -0
- data/lib/vagrant/config.rb +61 -0
- data/lib/vagrant/environment.rb +843 -0
- data/lib/vagrant/errors.rb +570 -0
- data/lib/vagrant/guest.rb +163 -0
- data/lib/vagrant/hosts.rb +28 -0
- data/lib/vagrant/machine.rb +325 -0
- data/lib/vagrant/machine_state.rb +45 -0
- data/lib/vagrant/plugin/v1/command.rb +169 -0
- data/lib/vagrant/plugin/v1/communicator.rb +98 -0
- data/lib/vagrant/plugin/v1/config.rb +112 -0
- data/lib/vagrant/plugin/v1/errors.rb +15 -0
- data/lib/vagrant/plugin/v1/guest.rb +92 -0
- data/lib/vagrant/plugin/v1/host.rb +66 -0
- data/lib/vagrant/plugin/v1/manager.rb +131 -0
- data/lib/vagrant/plugin/v1/plugin.rb +229 -0
- data/lib/vagrant/plugin/v1/provider.rb +68 -0
- data/lib/vagrant/plugin/v1/provisioner.rb +50 -0
- data/lib/vagrant/plugin/v1.rb +19 -0
- data/lib/vagrant/plugin/v2/command.rb +234 -0
- data/lib/vagrant/plugin/v2/communicator.rb +98 -0
- data/lib/vagrant/plugin/v2/components.rb +47 -0
- data/lib/vagrant/plugin/v2/config.rb +136 -0
- data/lib/vagrant/plugin/v2/errors.rb +15 -0
- data/lib/vagrant/plugin/v2/guest.rb +78 -0
- data/lib/vagrant/plugin/v2/host.rb +66 -0
- data/lib/vagrant/plugin/v2/manager.rb +173 -0
- data/lib/vagrant/plugin/v2/plugin.rb +226 -0
- data/lib/vagrant/plugin/v2/provider.rb +69 -0
- data/lib/vagrant/plugin/v2/provisioner.rb +47 -0
- data/lib/vagrant/plugin/v2.rb +22 -0
- data/lib/vagrant/plugin.rb +6 -0
- data/lib/vagrant/registry.rb +78 -0
- data/lib/vagrant/ui.rb +215 -0
- data/lib/vagrant/util/ansi_escape_code_remover.rb +34 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/counter.rb +24 -0
- data/lib/vagrant/util/downloader.rb +146 -0
- data/lib/vagrant/util/file_checksum.rb +38 -0
- data/lib/vagrant/util/file_mode.rb +12 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/is_port_open.rb +38 -0
- data/lib/vagrant/util/line_ending_helpers.rb +14 -0
- data/lib/vagrant/util/network_ip.rb +28 -0
- data/lib/vagrant/util/platform.rb +58 -0
- data/lib/vagrant/util/retryable.rb +31 -0
- data/lib/vagrant/util/safe_chdir.rb +33 -0
- data/lib/vagrant/util/safe_exec.rb +36 -0
- data/lib/vagrant/util/safe_puts.rb +31 -0
- data/lib/vagrant/util/scoped_hash_override.rb +45 -0
- data/lib/vagrant/util/ssh.rb +150 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
- data/lib/vagrant/util/string_block_editor.rb +77 -0
- data/lib/vagrant/util/subprocess.rb +273 -0
- data/lib/vagrant/util/template_renderer.rb +83 -0
- data/lib/vagrant/util/which.rb +43 -0
- data/lib/vagrant/util.rb +12 -0
- data/lib/vagrant/version.rb +6 -0
- data/lib/vagrant.rb +258 -0
- data/plugins/README.md +5 -0
- data/plugins/commands/box/command/add.rb +51 -0
- data/plugins/commands/box/command/list.rb +41 -0
- data/plugins/commands/box/command/remove.rb +37 -0
- data/plugins/commands/box/command/repackage.rb +43 -0
- data/plugins/commands/box/command/root.rb +75 -0
- data/plugins/commands/box/plugin.rb +15 -0
- data/plugins/commands/destroy/command.rb +31 -0
- data/plugins/commands/destroy/plugin.rb +18 -0
- data/plugins/commands/halt/command.rb +33 -0
- data/plugins/commands/halt/plugin.rb +18 -0
- data/plugins/commands/init/command.rb +40 -0
- data/plugins/commands/init/plugin.rb +18 -0
- data/plugins/commands/package/command.rb +83 -0
- data/plugins/commands/package/plugin.rb +18 -0
- data/plugins/commands/plugin/action/bundler_check.rb +25 -0
- data/plugins/commands/plugin/action/install_gem.rb +81 -0
- data/plugins/commands/plugin/action/license_plugin.rb +54 -0
- data/plugins/commands/plugin/action/list_plugins.rb +54 -0
- data/plugins/commands/plugin/action/prune_gems.rb +149 -0
- data/plugins/commands/plugin/action/uninstall_plugin.rb +23 -0
- data/plugins/commands/plugin/action.rb +52 -0
- data/plugins/commands/plugin/command/base.rb +22 -0
- data/plugins/commands/plugin/command/install.rb +58 -0
- data/plugins/commands/plugin/command/license.rb +31 -0
- data/plugins/commands/plugin/command/list.rb +28 -0
- data/plugins/commands/plugin/command/root.rb +75 -0
- data/plugins/commands/plugin/command/uninstall.rb +28 -0
- data/plugins/commands/plugin/gem_helper.rb +74 -0
- data/plugins/commands/plugin/plugin.rb +22 -0
- data/plugins/commands/plugin/state_file.rb +57 -0
- data/plugins/commands/provision/command.rb +34 -0
- data/plugins/commands/provision/plugin.rb +18 -0
- data/plugins/commands/reload/command.rb +37 -0
- data/plugins/commands/reload/plugin.rb +18 -0
- data/plugins/commands/resume/command.rb +25 -0
- data/plugins/commands/resume/plugin.rb +17 -0
- data/plugins/commands/ssh/command.rb +63 -0
- data/plugins/commands/ssh/plugin.rb +17 -0
- data/plugins/commands/ssh_config/command.rb +49 -0
- data/plugins/commands/ssh_config/plugin.rb +18 -0
- data/plugins/commands/status/command.rb +39 -0
- data/plugins/commands/status/plugin.rb +18 -0
- data/plugins/commands/suspend/command.rb +25 -0
- data/plugins/commands/suspend/plugin.rb +18 -0
- data/plugins/commands/up/command.rb +57 -0
- data/plugins/commands/up/plugin.rb +17 -0
- data/plugins/commands/up/start_mixins.rb +26 -0
- data/plugins/communicators/ssh/communicator.rb +342 -0
- data/plugins/communicators/ssh/plugin.rb +19 -0
- data/plugins/guests/arch/cap/change_host_name.rb +18 -0
- data/plugins/guests/arch/cap/configure_networks.rb +23 -0
- data/plugins/guests/arch/guest.rb +11 -0
- data/plugins/guests/arch/plugin.rb +25 -0
- data/plugins/guests/debian/cap/change_host_name.rb +18 -0
- data/plugins/guests/debian/cap/configure_networks.rb +61 -0
- data/plugins/guests/debian/guest.rb +9 -0
- data/plugins/guests/debian/plugin.rb +25 -0
- data/plugins/guests/fedora/cap/configure_networks.rb +59 -0
- data/plugins/guests/fedora/cap/network_scripts_dir.rb +15 -0
- data/plugins/guests/fedora/guest.rb +11 -0
- data/plugins/guests/fedora/plugin.rb +25 -0
- data/plugins/guests/freebsd/cap/change_host_name.rb +14 -0
- data/plugins/guests/freebsd/cap/configure_networks.rb +39 -0
- data/plugins/guests/freebsd/cap/halt.rb +16 -0
- data/plugins/guests/freebsd/cap/mount_nfs_folder.rb +14 -0
- data/plugins/guests/freebsd/guest.rb +14 -0
- data/plugins/guests/freebsd/plugin.rb +35 -0
- data/plugins/guests/gentoo/cap/change_host_name.rb +17 -0
- data/plugins/guests/gentoo/cap/configure_networks.rb +43 -0
- data/plugins/guests/gentoo/guest.rb +9 -0
- data/plugins/guests/gentoo/plugin.rb +25 -0
- data/plugins/guests/linux/cap/halt.rb +16 -0
- data/plugins/guests/linux/cap/mount_nfs.rb +30 -0
- data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +40 -0
- data/plugins/guests/linux/cap/read_ip_address.rb +17 -0
- data/plugins/guests/linux/cap/shell_expand_guest_path.rb +26 -0
- data/plugins/guests/linux/guest.rb +11 -0
- data/plugins/guests/linux/plugin.rb +40 -0
- data/plugins/guests/openbsd/cap/halt.rb +16 -0
- data/plugins/guests/openbsd/guest.rb +11 -0
- data/plugins/guests/openbsd/plugin.rb +20 -0
- data/plugins/guests/pld/cap/network_scripts_dir.rb +11 -0
- data/plugins/guests/pld/guest.rb +11 -0
- data/plugins/guests/pld/plugin.rb +20 -0
- data/plugins/guests/redhat/cap/change_host_name.rb +18 -0
- data/plugins/guests/redhat/cap/configure_networks.rb +60 -0
- data/plugins/guests/redhat/cap/network_scripts_dir.rb +11 -0
- data/plugins/guests/redhat/guest.rb +11 -0
- data/plugins/guests/redhat/plugin.rb +30 -0
- data/plugins/guests/solaris/cap/change_host_name.rb +17 -0
- data/plugins/guests/solaris/cap/configure_networks.rb +25 -0
- data/plugins/guests/solaris/cap/halt.rb +21 -0
- data/plugins/guests/solaris/cap/mount_virtualbox_shared_folder.rb +28 -0
- data/plugins/guests/solaris/config.rb +18 -0
- data/plugins/guests/solaris/guest.rb +14 -0
- data/plugins/guests/solaris/plugin.rb +40 -0
- data/plugins/guests/suse/cap/change_host_name.rb +18 -0
- data/plugins/guests/suse/cap/network_scripts_dir.rb +11 -0
- data/plugins/guests/suse/guest.rb +11 -0
- data/plugins/guests/suse/plugin.rb +25 -0
- data/plugins/guests/ubuntu/cap/change_host_name.rb +23 -0
- data/plugins/guests/ubuntu/guest.rb +32 -0
- data/plugins/guests/ubuntu/plugin.rb +20 -0
- data/plugins/hosts/arch/host.rb +68 -0
- data/plugins/hosts/arch/plugin.rb +15 -0
- data/plugins/hosts/bsd/host.rb +102 -0
- data/plugins/hosts/bsd/plugin.rb +15 -0
- data/plugins/hosts/fedora/host.rb +51 -0
- data/plugins/hosts/fedora/plugin.rb +15 -0
- data/plugins/hosts/freebsd/host.rb +43 -0
- data/plugins/hosts/freebsd/plugin.rb +15 -0
- data/plugins/hosts/gentoo/host.rb +24 -0
- data/plugins/hosts/gentoo/plugin.rb +15 -0
- data/plugins/hosts/linux/host.rb +95 -0
- data/plugins/hosts/linux/plugin.rb +15 -0
- data/plugins/hosts/opensuse/host.rb +34 -0
- data/plugins/hosts/opensuse/plugin.rb +15 -0
- data/plugins/hosts/windows/host.rb +17 -0
- data/plugins/hosts/windows/plugin.rb +15 -0
- data/plugins/kernel_v1/config/nfs.rb +20 -0
- data/plugins/kernel_v1/config/package.rb +17 -0
- data/plugins/kernel_v1/config/ssh.rb +46 -0
- data/plugins/kernel_v1/config/vagrant.rb +31 -0
- data/plugins/kernel_v1/config/vm.rb +184 -0
- data/plugins/kernel_v1/plugin.rb +44 -0
- data/plugins/kernel_v2/config/nfs.rb +14 -0
- data/plugins/kernel_v2/config/package.rb +13 -0
- data/plugins/kernel_v2/config/ssh.rb +76 -0
- data/plugins/kernel_v2/config/ssh_connect.rb +40 -0
- data/plugins/kernel_v2/config/vagrant.rb +13 -0
- data/plugins/kernel_v2/config/vm.rb +416 -0
- data/plugins/kernel_v2/config/vm_provisioner.rb +55 -0
- data/plugins/kernel_v2/config/vm_subvm.rb +30 -0
- data/plugins/kernel_v2/plugin.rb +44 -0
- data/plugins/providers/virtualbox/action/boot.rb +49 -0
- data/plugins/providers/virtualbox/action/check_accessible.rb +23 -0
- data/plugins/providers/virtualbox/action/check_created.rb +21 -0
- data/plugins/providers/virtualbox/action/check_guest_additions.rb +45 -0
- data/plugins/providers/virtualbox/action/check_running.rb +21 -0
- data/plugins/providers/virtualbox/action/check_virtualbox.rb +22 -0
- data/plugins/providers/virtualbox/action/clean_machine_folder.rb +43 -0
- data/plugins/providers/virtualbox/action/clear_forwarded_ports.rb +18 -0
- data/plugins/providers/virtualbox/action/clear_network_interfaces.rb +31 -0
- data/plugins/providers/virtualbox/action/clear_shared_folders.rb +17 -0
- data/plugins/providers/virtualbox/action/created.rb +20 -0
- data/plugins/providers/virtualbox/action/customize.rb +36 -0
- data/plugins/providers/virtualbox/action/destroy.rb +19 -0
- data/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +16 -0
- data/plugins/providers/virtualbox/action/discard_state.rb +20 -0
- data/plugins/providers/virtualbox/action/export.rb +57 -0
- data/plugins/providers/virtualbox/action/forced_halt.rb +25 -0
- data/plugins/providers/virtualbox/action/forward_ports.rb +87 -0
- data/plugins/providers/virtualbox/action/import.rb +51 -0
- data/plugins/providers/virtualbox/action/is_paused.rb +20 -0
- data/plugins/providers/virtualbox/action/is_running.rb +20 -0
- data/plugins/providers/virtualbox/action/is_saved.rb +20 -0
- data/plugins/providers/virtualbox/action/match_mac_address.rb +21 -0
- data/plugins/providers/virtualbox/action/message_already_running.rb +16 -0
- data/plugins/providers/virtualbox/action/message_not_created.rb +16 -0
- data/plugins/providers/virtualbox/action/message_not_running.rb +16 -0
- data/plugins/providers/virtualbox/action/message_will_not_destroy.rb +17 -0
- data/plugins/providers/virtualbox/action/network.rb +410 -0
- data/plugins/providers/virtualbox/action/package.rb +20 -0
- data/plugins/providers/virtualbox/action/package_vagrantfile.rb +33 -0
- data/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb +35 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +64 -0
- data/plugins/providers/virtualbox/action/prune_nfs_exports.rb +20 -0
- data/plugins/providers/virtualbox/action/resume.rb +25 -0
- data/plugins/providers/virtualbox/action/sane_defaults.rb +91 -0
- data/plugins/providers/virtualbox/action/set_name.rb +40 -0
- data/plugins/providers/virtualbox/action/setup_package_files.rb +51 -0
- data/plugins/providers/virtualbox/action/share_folders.rb +128 -0
- data/plugins/providers/virtualbox/action/suspend.rb +20 -0
- data/plugins/providers/virtualbox/action.rb +311 -0
- data/plugins/providers/virtualbox/config.rb +86 -0
- data/plugins/providers/virtualbox/driver/base.rb +360 -0
- data/plugins/providers/virtualbox/driver/meta.rb +142 -0
- data/plugins/providers/virtualbox/driver/version_4_0.rb +485 -0
- data/plugins/providers/virtualbox/driver/version_4_1.rb +485 -0
- data/plugins/providers/virtualbox/driver/version_4_2.rb +482 -0
- data/plugins/providers/virtualbox/model/forwarded_port.rb +58 -0
- data/plugins/providers/virtualbox/plugin.rb +42 -0
- data/plugins/providers/virtualbox/provider.rb +92 -0
- data/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +31 -0
- data/plugins/provisioners/ansible/config.rb +72 -0
- data/plugins/provisioners/ansible/plugin.rb +23 -0
- data/plugins/provisioners/ansible/provisioner.rb +45 -0
- data/plugins/provisioners/cfengine/cap/debian/cfengine_install.rb +19 -0
- data/plugins/provisioners/cfengine/cap/linux/cfengine_installed.rb +14 -0
- data/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb +34 -0
- data/plugins/provisioners/cfengine/cap/redhat/cfengine_install.rb +24 -0
- data/plugins/provisioners/cfengine/config.rb +120 -0
- data/plugins/provisioners/cfengine/plugin.rb +42 -0
- data/plugins/provisioners/cfengine/provisioner.rb +136 -0
- data/plugins/provisioners/chef/config/base.rb +85 -0
- data/plugins/provisioners/chef/config/chef_client.rb +57 -0
- data/plugins/provisioners/chef/config/chef_solo.rb +87 -0
- data/plugins/provisioners/chef/plugin.rb +33 -0
- data/plugins/provisioners/chef/provisioner/base.rb +93 -0
- data/plugins/provisioners/chef/provisioner/chef_client.rb +107 -0
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +192 -0
- data/plugins/provisioners/puppet/config/puppet.rb +70 -0
- data/plugins/provisioners/puppet/config/puppet_server.rb +16 -0
- data/plugins/provisioners/puppet/plugin.rb +33 -0
- data/plugins/provisioners/puppet/provisioner/puppet.rb +117 -0
- data/plugins/provisioners/puppet/provisioner/puppet_server.rb +67 -0
- data/plugins/provisioners/shell/config.rb +56 -0
- data/plugins/provisioners/shell/plugin.rb +23 -0
- data/plugins/provisioners/shell/provisioner.rb +86 -0
- data/tasks/acceptance.rake +113 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +20 -0
- data/templates/commands/init/Vagrantfile.erb +111 -0
- data/templates/commands/ssh_config/config.erb +16 -0
- data/templates/config/messages.erb +14 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/guests/arch/network_dhcp.erb +4 -0
- data/templates/guests/arch/network_static.erb +6 -0
- data/templates/guests/debian/network_dhcp.erb +11 -0
- data/templates/guests/debian/network_static.erb +7 -0
- data/templates/guests/fedora/network_dhcp.erb +6 -0
- data/templates/guests/fedora/network_static.erb +13 -0
- data/templates/guests/freebsd/network_dhcp.erb +3 -0
- data/templates/guests/freebsd/network_static.erb +3 -0
- data/templates/guests/gentoo/network_dhcp.erb +4 -0
- data/templates/guests/gentoo/network_static.erb +4 -0
- data/templates/guests/redhat/network_dhcp.erb +6 -0
- data/templates/guests/redhat/network_static.erb +8 -0
- data/templates/locales/en.yml +1126 -0
- data/templates/nfs/exports.erb +5 -0
- data/templates/nfs/exports_freebsd.erb +5 -0
- data/templates/nfs/exports_linux.erb +5 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/provisioners/chef_client/client.erb +32 -0
- data/templates/provisioners/chef_solo/solo.erb +25 -0
- data/templates/rgloader.rb +9 -0
- data/test/acceptance/base.rb +48 -0
- data/test/acceptance/box_test.rb +99 -0
- data/test/acceptance/destroy_test.rb +37 -0
- data/test/acceptance/halt_test.rb +72 -0
- data/test/acceptance/init_test.rb +33 -0
- data/test/acceptance/networking/host_only_test.rb +37 -0
- data/test/acceptance/networking/port_forward_test.rb +125 -0
- data/test/acceptance/package_test.rb +46 -0
- data/test/acceptance/provisioning/basic_test.rb +61 -0
- data/test/acceptance/provisioning/chef_solo_test.rb +37 -0
- data/test/acceptance/provisioning/shell_test.rb +53 -0
- data/test/acceptance/resume_test.rb +17 -0
- data/test/acceptance/shared_folders_test.rb +84 -0
- data/test/acceptance/skeletons/chef_solo_basic/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/skeletons/chef_solo_json/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +6 -0
- data/test/acceptance/skeletons/provisioner_multi/README.md +3 -0
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/ssh_test.rb +46 -0
- data/test/acceptance/support/config.rb +42 -0
- data/test/acceptance/support/isolated_environment.rb +118 -0
- data/test/acceptance/support/matchers/have_color.rb +9 -0
- data/test/acceptance/support/matchers/match_output.rb +14 -0
- data/test/acceptance/support/matchers/succeed.rb +14 -0
- data/test/acceptance/support/network_tests.rb +29 -0
- data/test/acceptance/support/output.rb +95 -0
- data/test/acceptance/support/shared/base_context.rb +72 -0
- data/test/acceptance/support/shared/command_examples.rb +33 -0
- data/test/acceptance/support/virtualbox.rb +36 -0
- data/test/acceptance/suspend_test.rb +56 -0
- data/test/acceptance/up_basic_test.rb +33 -0
- data/test/acceptance/up_with_box_url.rb +40 -0
- data/test/acceptance/vagrant_test.rb +47 -0
- data/test/acceptance/version_test.rb +15 -0
- data/test/config/acceptance_boxes.yml +7 -0
- data/test/support/isolated_environment.rb +46 -0
- data/test/support/tempdir.rb +43 -0
- data/test/unit/base.rb +27 -0
- data/test/unit/support/dummy_provider.rb +16 -0
- data/test/unit/support/isolated_environment.rb +179 -0
- data/test/unit/support/shared/base_context.rb +104 -0
- data/test/unit/vagrant/action/builder_test.rb +242 -0
- data/test/unit/vagrant/action/builtin/call_test.rb +145 -0
- data/test/unit/vagrant/action/builtin/confirm_test.rb +36 -0
- data/test/unit/vagrant/action/builtin/env_set_test.rb +20 -0
- data/test/unit/vagrant/action/builtin/graceful_halt_test.rb +61 -0
- data/test/unit/vagrant/action/builtin/lock_test.rb +98 -0
- data/test/unit/vagrant/action/builtin/ssh_exec_test.rb +57 -0
- data/test/unit/vagrant/action/hook_test.rb +120 -0
- data/test/unit/vagrant/action/runner_test.rb +71 -0
- data/test/unit/vagrant/action/warden_test.rb +92 -0
- data/test/unit/vagrant/batch_action_test.rb +36 -0
- data/test/unit/vagrant/box_collection_test.rb +237 -0
- data/test/unit/vagrant/box_test.rb +122 -0
- data/test/unit/vagrant/cli_test.rb +27 -0
- data/test/unit/vagrant/config/loader_test.rb +184 -0
- data/test/unit/vagrant/config/v1/dummy_config_test.rb +24 -0
- data/test/unit/vagrant/config/v1/loader_test.rb +145 -0
- data/test/unit/vagrant/config/v1/root_test.rb +40 -0
- data/test/unit/vagrant/config/v2/dummy_config_test.rb +24 -0
- data/test/unit/vagrant/config/v2/loader_test.rb +151 -0
- data/test/unit/vagrant/config/v2/root_test.rb +97 -0
- data/test/unit/vagrant/config/v2/util_test.rb +21 -0
- data/test/unit/vagrant/config_test.rb +66 -0
- data/test/unit/vagrant/environment_test.rb +721 -0
- data/test/unit/vagrant/guest_test.rb +166 -0
- data/test/unit/vagrant/hosts_test.rb +37 -0
- data/test/unit/vagrant/machine_state_test.rb +26 -0
- data/test/unit/vagrant/machine_test.rb +384 -0
- data/test/unit/vagrant/plugin/v1/command_test.rb +143 -0
- data/test/unit/vagrant/plugin/v1/communicator_test.rb +9 -0
- data/test/unit/vagrant/plugin/v1/config_test.rb +50 -0
- data/test/unit/vagrant/plugin/v1/host_test.rb +5 -0
- data/test/unit/vagrant/plugin/v1/manager_test.rb +114 -0
- data/test/unit/vagrant/plugin/v1/plugin_test.rb +267 -0
- data/test/unit/vagrant/plugin/v1/provider_test.rb +18 -0
- data/test/unit/vagrant/plugin/v2/command_test.rb +238 -0
- data/test/unit/vagrant/plugin/v2/communicator_test.rb +9 -0
- data/test/unit/vagrant/plugin/v2/components_test.rb +17 -0
- data/test/unit/vagrant/plugin/v2/config_test.rb +60 -0
- data/test/unit/vagrant/plugin/v2/host_test.rb +5 -0
- data/test/unit/vagrant/plugin/v2/manager_test.rb +174 -0
- data/test/unit/vagrant/plugin/v2/plugin_test.rb +305 -0
- data/test/unit/vagrant/plugin/v2/provider_test.rb +18 -0
- data/test/unit/vagrant/registry_test.rb +128 -0
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +16 -0
- data/test/unit/vagrant/util/downloader_test.rb +57 -0
- data/test/unit/vagrant/util/file_checksum_test.rb +23 -0
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +38 -0
- data/test/unit/vagrant/util/is_port_open_test.rb +53 -0
- data/test/unit/vagrant/util/line_endings_helper_test.rb +16 -0
- data/test/unit/vagrant/util/network_ip_test.rb +17 -0
- data/test/unit/vagrant/util/retryable_test.rb +106 -0
- data/test/unit/vagrant/util/safe_chdir_test.rb +43 -0
- data/test/unit/vagrant/util/scoped_hash_override_test.rb +48 -0
- data/test/unit/vagrant/util/ssh_test.rb +30 -0
- data/test/unit/vagrant/util/string_block_editor_test.rb +106 -0
- data/test/unit/vagrant/util/which_test.rb +43 -0
- data/test/unit/vagrant_test.rb +56 -0
- data/tnargav.gemspec +69 -0
- data/vagrant.gemspec +69 -0
- metadata +730 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
require "vagrant/action/builder"
|
|
2
|
+
|
|
3
|
+
module VagrantPlugins
|
|
4
|
+
module ProviderVirtualBox
|
|
5
|
+
module Action
|
|
6
|
+
autoload :Boot, File.expand_path("../action/boot", __FILE__)
|
|
7
|
+
autoload :CheckAccessible, File.expand_path("../action/check_accessible", __FILE__)
|
|
8
|
+
autoload :CheckCreated, File.expand_path("../action/check_created", __FILE__)
|
|
9
|
+
autoload :CheckGuestAdditions, File.expand_path("../action/check_guest_additions", __FILE__)
|
|
10
|
+
autoload :CheckRunning, File.expand_path("../action/check_running", __FILE__)
|
|
11
|
+
autoload :CheckVirtualbox, File.expand_path("../action/check_virtualbox", __FILE__)
|
|
12
|
+
autoload :CleanMachineFolder, File.expand_path("../action/clean_machine_folder", __FILE__)
|
|
13
|
+
autoload :ClearForwardedPorts, File.expand_path("../action/clear_forwarded_ports", __FILE__)
|
|
14
|
+
autoload :ClearNetworkInterfaces, File.expand_path("../action/clear_network_interfaces", __FILE__)
|
|
15
|
+
autoload :ClearSharedFolders, File.expand_path("../action/clear_shared_folders", __FILE__)
|
|
16
|
+
autoload :Created, File.expand_path("../action/created", __FILE__)
|
|
17
|
+
autoload :Customize, File.expand_path("../action/customize", __FILE__)
|
|
18
|
+
autoload :Destroy, File.expand_path("../action/destroy", __FILE__)
|
|
19
|
+
autoload :DestroyUnusedNetworkInterfaces, File.expand_path("../action/destroy_unused_network_interfaces", __FILE__)
|
|
20
|
+
autoload :DiscardState, File.expand_path("../action/discard_state", __FILE__)
|
|
21
|
+
autoload :Export, File.expand_path("../action/export", __FILE__)
|
|
22
|
+
autoload :ForcedHalt, File.expand_path("../action/forced_halt", __FILE__)
|
|
23
|
+
autoload :ForwardPorts, File.expand_path("../action/forward_ports", __FILE__)
|
|
24
|
+
autoload :Import, File.expand_path("../action/import", __FILE__)
|
|
25
|
+
autoload :IsPaused, File.expand_path("../action/is_paused", __FILE__)
|
|
26
|
+
autoload :IsRunning, File.expand_path("../action/is_running", __FILE__)
|
|
27
|
+
autoload :IsSaved, File.expand_path("../action/is_saved", __FILE__)
|
|
28
|
+
autoload :MatchMACAddress, File.expand_path("../action/match_mac_address", __FILE__)
|
|
29
|
+
autoload :MessageAlreadyRunning, File.expand_path("../action/message_already_running", __FILE__)
|
|
30
|
+
autoload :MessageNotCreated, File.expand_path("../action/message_not_created", __FILE__)
|
|
31
|
+
autoload :MessageNotRunning, File.expand_path("../action/message_not_running", __FILE__)
|
|
32
|
+
autoload :MessageWillNotDestroy, File.expand_path("../action/message_will_not_destroy", __FILE__)
|
|
33
|
+
autoload :Network, File.expand_path("../action/network", __FILE__)
|
|
34
|
+
autoload :Package, File.expand_path("../action/package", __FILE__)
|
|
35
|
+
autoload :PackageVagrantfile, File.expand_path("../action/package_vagrantfile", __FILE__)
|
|
36
|
+
autoload :PrepareNFSSettings, File.expand_path("../action/prepare_nfs_settings", __FILE__)
|
|
37
|
+
autoload :PrepareForwardedPortCollisionParams, File.expand_path("../action/prepare_forwarded_port_collision_params", __FILE__)
|
|
38
|
+
autoload :PruneNFSExports, File.expand_path("../action/prune_nfs_exports", __FILE__)
|
|
39
|
+
autoload :Resume, File.expand_path("../action/resume", __FILE__)
|
|
40
|
+
autoload :SaneDefaults, File.expand_path("../action/sane_defaults", __FILE__)
|
|
41
|
+
autoload :SetName, File.expand_path("../action/set_name", __FILE__)
|
|
42
|
+
autoload :SetupPackageFiles, File.expand_path("../action/setup_package_files", __FILE__)
|
|
43
|
+
autoload :ShareFolders, File.expand_path("../action/share_folders", __FILE__)
|
|
44
|
+
autoload :Suspend, File.expand_path("../action/suspend", __FILE__)
|
|
45
|
+
|
|
46
|
+
# Include the built-in modules so that we can use them as top-level
|
|
47
|
+
# things.
|
|
48
|
+
include Vagrant::Action::Builtin
|
|
49
|
+
|
|
50
|
+
# This action boots the VM, assuming the VM is in a state that requires
|
|
51
|
+
# a bootup (i.e. not saved).
|
|
52
|
+
def self.action_boot
|
|
53
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
54
|
+
b.use CheckAccessible
|
|
55
|
+
b.use CleanMachineFolder
|
|
56
|
+
b.use SetName
|
|
57
|
+
b.use ClearForwardedPorts
|
|
58
|
+
b.use Provision
|
|
59
|
+
b.use EnvSet, :port_collision_repair => true
|
|
60
|
+
b.use PrepareForwardedPortCollisionParams
|
|
61
|
+
b.use HandleForwardedPortCollisions
|
|
62
|
+
b.use PruneNFSExports
|
|
63
|
+
b.use NFS
|
|
64
|
+
b.use PrepareNFSSettings
|
|
65
|
+
b.use ClearSharedFolders
|
|
66
|
+
b.use ShareFolders
|
|
67
|
+
b.use ClearNetworkInterfaces
|
|
68
|
+
b.use Network
|
|
69
|
+
b.use ForwardPorts
|
|
70
|
+
b.use SetHostname
|
|
71
|
+
b.use SaneDefaults
|
|
72
|
+
b.use Customize
|
|
73
|
+
b.use Boot
|
|
74
|
+
b.use CheckGuestAdditions
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# This is the action that is primarily responsible for completely
|
|
79
|
+
# freeing the resources of the underlying virtual machine.
|
|
80
|
+
def self.action_destroy
|
|
81
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
82
|
+
b.use CheckVirtualbox
|
|
83
|
+
b.use Call, Created do |env1, b2|
|
|
84
|
+
if !env1[:result]
|
|
85
|
+
b2.use MessageNotCreated
|
|
86
|
+
next
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
b2.use Call, DestroyConfirm do |env2, b3|
|
|
90
|
+
if env2[:result]
|
|
91
|
+
b3.use ConfigValidate
|
|
92
|
+
b3.use CheckAccessible
|
|
93
|
+
b3.use EnvSet, :force_halt => true
|
|
94
|
+
b3.use action_halt
|
|
95
|
+
b3.use PruneNFSExports
|
|
96
|
+
b3.use Destroy
|
|
97
|
+
b3.use CleanMachineFolder
|
|
98
|
+
b3.use DestroyUnusedNetworkInterfaces
|
|
99
|
+
else
|
|
100
|
+
b3.use MessageWillNotDestroy
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# This is the action that is primarily responsible for halting
|
|
108
|
+
# the virtual machine, gracefully or by force.
|
|
109
|
+
def self.action_halt
|
|
110
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
111
|
+
b.use CheckVirtualbox
|
|
112
|
+
b.use Call, Created do |env, b2|
|
|
113
|
+
if env[:result]
|
|
114
|
+
b2.use CheckAccessible
|
|
115
|
+
b2.use DiscardState
|
|
116
|
+
|
|
117
|
+
b2.use Call, IsPaused do |env2, b3|
|
|
118
|
+
next if !env2[:result]
|
|
119
|
+
b3.use Resume
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
b2.use Call, GracefulHalt, :poweroff, :running do |env2, b3|
|
|
123
|
+
if !env2[:result]
|
|
124
|
+
b3.use ForcedHalt
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
else
|
|
128
|
+
b2.use MessageNotCreated
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# This action packages the virtual machine into a single box file.
|
|
135
|
+
def self.action_package
|
|
136
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
137
|
+
b.use CheckVirtualbox
|
|
138
|
+
b.use Call, Created do |env1, b2|
|
|
139
|
+
if !env1[:result]
|
|
140
|
+
b2.use MessageNotCreated
|
|
141
|
+
next
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
b2.use SetupPackageFiles
|
|
145
|
+
b2.use CheckAccessible
|
|
146
|
+
b2.use action_halt
|
|
147
|
+
b2.use ClearForwardedPorts
|
|
148
|
+
b2.use ClearSharedFolders
|
|
149
|
+
b2.use Export
|
|
150
|
+
b2.use PackageVagrantfile
|
|
151
|
+
b2.use Package
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# This action just runs the provisioners on the machine.
|
|
157
|
+
def self.action_provision
|
|
158
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
159
|
+
b.use CheckVirtualbox
|
|
160
|
+
b.use ConfigValidate
|
|
161
|
+
b.use Call, Created do |env1, b2|
|
|
162
|
+
if !env1[:result]
|
|
163
|
+
b2.use MessageNotCreated
|
|
164
|
+
next
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
b2.use Call, IsRunning do |env2, b3|
|
|
168
|
+
if !env2[:result]
|
|
169
|
+
b3.use MessageNotRunning
|
|
170
|
+
next
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
b3.use CheckAccessible
|
|
174
|
+
b3.use Provision
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# This action is responsible for reloading the machine, which
|
|
181
|
+
# brings it down, sucks in new configuration, and brings the
|
|
182
|
+
# machine back up with the new configuration.
|
|
183
|
+
def self.action_reload
|
|
184
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
185
|
+
b.use CheckVirtualbox
|
|
186
|
+
b.use Call, Created do |env1, b2|
|
|
187
|
+
if !env1[:result]
|
|
188
|
+
b2.use MessageNotCreated
|
|
189
|
+
next
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
b2.use ConfigValidate
|
|
193
|
+
b2.use action_halt
|
|
194
|
+
b2.use action_start
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# This is the action that is primarily responsible for resuming
|
|
200
|
+
# suspended machines.
|
|
201
|
+
def self.action_resume
|
|
202
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
203
|
+
b.use CheckVirtualbox
|
|
204
|
+
b.use Call, Created do |env, b2|
|
|
205
|
+
if env[:result]
|
|
206
|
+
b2.use CheckAccessible
|
|
207
|
+
b2.use EnvSet, :port_collision_repair => false
|
|
208
|
+
b2.use PrepareForwardedPortCollisionParams
|
|
209
|
+
b2.use HandleForwardedPortCollisions
|
|
210
|
+
b2.use Resume
|
|
211
|
+
else
|
|
212
|
+
b2.use MessageNotCreated
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# This is the action that will exec into an SSH shell.
|
|
219
|
+
def self.action_ssh
|
|
220
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
221
|
+
b.use CheckVirtualbox
|
|
222
|
+
b.use CheckCreated
|
|
223
|
+
b.use CheckAccessible
|
|
224
|
+
b.use CheckRunning
|
|
225
|
+
b.use SSHExec
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# This is the action that will run a single SSH command.
|
|
230
|
+
def self.action_ssh_run
|
|
231
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
232
|
+
b.use CheckVirtualbox
|
|
233
|
+
b.use CheckCreated
|
|
234
|
+
b.use CheckAccessible
|
|
235
|
+
b.use CheckRunning
|
|
236
|
+
b.use SSHRun
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# This action starts a VM, assuming it is already imported and exists.
|
|
241
|
+
# A precondition of this action is that the VM exists.
|
|
242
|
+
def self.action_start
|
|
243
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
244
|
+
b.use CheckVirtualbox
|
|
245
|
+
b.use ConfigValidate
|
|
246
|
+
b.use Call, IsRunning do |env, b2|
|
|
247
|
+
# If the VM is running, then our work here is done, exit
|
|
248
|
+
if env[:result]
|
|
249
|
+
b2.use MessageAlreadyRunning
|
|
250
|
+
next
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
b2.use Call, IsSaved do |env2, b3|
|
|
254
|
+
if env2[:result]
|
|
255
|
+
# The VM is saved, so just resume it
|
|
256
|
+
b3.use action_resume
|
|
257
|
+
next
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
b3.use Call, IsPaused do |env3, b4|
|
|
261
|
+
if env3[:result]
|
|
262
|
+
b4.use Resume
|
|
263
|
+
next
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# The VM is not saved, so we must have to boot it up
|
|
267
|
+
# like normal. Boot!
|
|
268
|
+
b4.use action_boot
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# This is the action that is primarily responsible for suspending
|
|
276
|
+
# the virtual machine.
|
|
277
|
+
def self.action_suspend
|
|
278
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
279
|
+
b.use CheckVirtualbox
|
|
280
|
+
b.use Call, Created do |env, b2|
|
|
281
|
+
if env[:result]
|
|
282
|
+
b2.use CheckAccessible
|
|
283
|
+
b2.use Suspend
|
|
284
|
+
else
|
|
285
|
+
b2.use MessageNotCreated
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# This action brings the machine up from nothing, including importing
|
|
292
|
+
# the box, configuring metadata, and booting.
|
|
293
|
+
def self.action_up
|
|
294
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
295
|
+
b.use CheckVirtualbox
|
|
296
|
+
b.use ConfigValidate
|
|
297
|
+
b.use Call, Created do |env, b2|
|
|
298
|
+
# If the VM is NOT created yet, then do the setup steps
|
|
299
|
+
if !env[:result]
|
|
300
|
+
b2.use CheckAccessible
|
|
301
|
+
b2.use HandleBoxUrl
|
|
302
|
+
b2.use Import
|
|
303
|
+
b2.use MatchMACAddress
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
b.use action_start
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
module VagrantPlugins
|
|
2
|
+
module ProviderVirtualBox
|
|
3
|
+
class Config < Vagrant.plugin("2", :config)
|
|
4
|
+
# Vagrant by default will make "smart" decisions to enable/disable
|
|
5
|
+
# the NAT DNS proxy. If this is set to `true`, then the DNS proxy
|
|
6
|
+
# will not be enabled, and it is up to the end user to do it.
|
|
7
|
+
#
|
|
8
|
+
# @return [Boolean]
|
|
9
|
+
attr_accessor :auto_nat_dns_proxy
|
|
10
|
+
|
|
11
|
+
# An array of customizations to make on the VM prior to booting it.
|
|
12
|
+
#
|
|
13
|
+
# @return [Array]
|
|
14
|
+
attr_reader :customizations
|
|
15
|
+
|
|
16
|
+
# If set to `true`, then VirtualBox will be launched with a GUI.
|
|
17
|
+
#
|
|
18
|
+
# @return [Boolean]
|
|
19
|
+
attr_accessor :gui
|
|
20
|
+
|
|
21
|
+
# This should be set to the name of the machine in the VirtualBox
|
|
22
|
+
# GUI.
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :name
|
|
26
|
+
|
|
27
|
+
# The defined network adapters.
|
|
28
|
+
#
|
|
29
|
+
# @return [Hash]
|
|
30
|
+
attr_reader :network_adapters
|
|
31
|
+
|
|
32
|
+
def initialize
|
|
33
|
+
@auto_nat_dns_proxy = UNSET_VALUE
|
|
34
|
+
@customizations = []
|
|
35
|
+
@name = UNSET_VALUE
|
|
36
|
+
@network_adapters = {}
|
|
37
|
+
@gui = UNSET_VALUE
|
|
38
|
+
|
|
39
|
+
# We require that network adapter 1 is a NAT device.
|
|
40
|
+
network_adapter(1, :nat)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Customize the VM by calling `VBoxManage` with the given
|
|
44
|
+
# arguments.
|
|
45
|
+
#
|
|
46
|
+
# When called multiple times, the customizations will be applied
|
|
47
|
+
# in the order given.
|
|
48
|
+
#
|
|
49
|
+
# The special `:name` parameter in the command will be replaced with
|
|
50
|
+
# the unique ID or name of the virtual machine. This is useful for
|
|
51
|
+
# parameters to `modifyvm` and the like.
|
|
52
|
+
#
|
|
53
|
+
# @param [Array] command An array of arguments to pass to
|
|
54
|
+
# VBoxManage.
|
|
55
|
+
def customize(command)
|
|
56
|
+
@customizations << command
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# This defines a network adapter that will be added to the VirtualBox
|
|
60
|
+
# virtual machine in the given slot.
|
|
61
|
+
#
|
|
62
|
+
# @param [Integer] slot The slot for this network adapter.
|
|
63
|
+
# @param [Symbol] type The type of adapter.
|
|
64
|
+
def network_adapter(slot, type, *args)
|
|
65
|
+
@network_adapters[slot] = [type, args]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# This is the hook that is called to finalize the object before it
|
|
69
|
+
# is put into use.
|
|
70
|
+
def finalize!
|
|
71
|
+
# Default is to auto the DNS proxy
|
|
72
|
+
@auto_nat_dns_proxy = true if @auto_nat_dns_proxy == UNSET_VALUE
|
|
73
|
+
|
|
74
|
+
# Default is to not show a GUI
|
|
75
|
+
@gui = false if @gui == UNSET_VALUE
|
|
76
|
+
|
|
77
|
+
# The default name is just nothing, and we default it
|
|
78
|
+
@name = nil if @name == UNSET_VALUE
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def to_s
|
|
82
|
+
"VirtualBox"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|