vagrant-unbundled 1.8.1.2 → 1.8.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -13
- data/.travis.yml +3 -0
- data/CHANGELOG.md +167 -4
- data/LICENSE +1 -1
- data/README.md +7 -9
- data/RELEASE.md +28 -0
- data/bin/vagrant +1 -1
- data/contrib/bash/completion.sh +6 -1
- data/contrib/sudoers/linux-fedora +1 -1
- data/keys/README.md +1 -1
- data/lib/vagrant/action/builtin/box_add.rb +7 -3
- data/lib/vagrant/action/general/package.rb +47 -13
- data/lib/vagrant/box.rb +1 -1
- data/lib/vagrant/box_collection.rb +3 -4
- data/lib/vagrant/bundler.rb +29 -11
- data/lib/vagrant/machine.rb +14 -5
- data/lib/vagrant/ui.rb +1 -1
- data/lib/vagrant/util/is_port_open.rb +1 -1
- data/lib/vagrant/util/platform.rb +67 -42
- data/plugins/commands/box/command/remove.rb +1 -1
- data/plugins/commands/box/command/update.rb +10 -0
- data/plugins/commands/destroy/command.rb +1 -1
- data/plugins/commands/halt/command.rb +1 -1
- data/plugins/commands/init/command.rb +8 -2
- data/plugins/commands/login/client.rb +19 -1
- data/plugins/commands/package/command.rb +1 -1
- data/plugins/commands/plugin/command/mixin_install_opts.rb +1 -1
- data/plugins/commands/plugin/gem_helper.rb +1 -1
- data/plugins/commands/port/command.rb +1 -1
- data/plugins/commands/rdp/command.rb +1 -1
- data/plugins/commands/resume/command.rb +15 -1
- data/plugins/commands/snapshot/command/pop.rb +16 -1
- data/plugins/commands/snapshot/command/push_shared.rb +7 -9
- data/plugins/commands/snapshot/command/restore.rb +14 -1
- data/plugins/commands/ssh/command.rb +2 -1
- data/plugins/commands/ssh_config/command.rb +1 -1
- data/plugins/commands/status/command.rb +1 -1
- data/plugins/commands/suspend/command.rb +1 -1
- data/plugins/commands/up/command.rb +4 -4
- data/plugins/communicators/ssh/communicator.rb +2 -2
- data/plugins/communicators/winrm/communicator.rb +11 -11
- data/plugins/communicators/winrm/config.rb +7 -1
- data/plugins/communicators/winrm/shell.rb +41 -41
- data/plugins/guests/amazon/cap/flavor.rb +14 -0
- data/plugins/guests/amazon/guest.rb +9 -0
- data/plugins/guests/amazon/plugin.rb +20 -0
- data/plugins/guests/arch/cap/change_host_name.rb +15 -6
- data/plugins/guests/arch/cap/configure_networks.rb +33 -14
- data/plugins/guests/arch/plugin.rb +1 -1
- data/plugins/guests/atomic/cap/change_host_name.rb +16 -1
- data/plugins/guests/atomic/plugin.rb +2 -2
- data/plugins/guests/coreos/cap/change_host_name.rb +10 -4
- data/plugins/guests/coreos/cap/configure_networks.rb +49 -37
- data/plugins/guests/coreos/guest.rb +2 -0
- data/plugins/guests/coreos/plugin.rb +1 -1
- data/plugins/guests/darwin/cap/change_host_name.rb +25 -7
- data/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb +7 -7
- data/plugins/guests/darwin/cap/insert_public_key.rb +19 -7
- data/plugins/guests/darwin/guest.rb +1 -1
- data/plugins/guests/darwin/plugin.rb +1 -1
- data/plugins/guests/debian/cap/change_host_name.rb +37 -84
- data/plugins/guests/debian/cap/configure_networks.rb +61 -46
- data/plugins/guests/debian/cap/nfs_client.rb +5 -4
- data/plugins/guests/debian/cap/rsync.rb +6 -3
- data/plugins/guests/debian/cap/smb.rb +6 -7
- data/plugins/guests/debian/guest.rb +2 -0
- data/plugins/guests/debian/plugin.rb +1 -1
- data/plugins/guests/fedora/cap/change_host_name.rb +18 -64
- data/plugins/guests/fedora/cap/configure_networks.rb +10 -9
- data/plugins/guests/fedora/plugin.rb +1 -1
- data/plugins/guests/freebsd/cap/change_host_name.rb +21 -3
- data/plugins/guests/freebsd/cap/configure_networks.rb +45 -30
- data/plugins/guests/freebsd/cap/halt.rb +1 -1
- data/plugins/guests/freebsd/cap/insert_public_key.rb +21 -8
- data/plugins/guests/freebsd/cap/mount_nfs_folder.rb +10 -7
- data/plugins/guests/freebsd/cap/rsync.rb +1 -11
- data/plugins/guests/freebsd/plugin.rb +1 -1
- data/plugins/guests/funtoo/cap/configure_networks.rb +10 -6
- data/plugins/guests/gentoo/cap/configure_networks.rb +9 -8
- data/plugins/guests/linux/cap/choose_addressable_ip_addr.rb +6 -6
- data/plugins/guests/linux/cap/insert_public_key.rb +18 -8
- data/plugins/guests/linux/cap/mount_nfs.rb +16 -12
- data/plugins/guests/linux/cap/mount_smb_shared_folder.rb +2 -2
- data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +1 -1
- data/plugins/guests/linux/guest.rb +0 -2
- data/plugins/guests/linux/plugin.rb +1 -1
- data/plugins/guests/mint/guest.rb +0 -2
- data/plugins/guests/mint/plugin.rb +1 -1
- data/plugins/guests/netbsd/cap/configure_networks.rb +8 -8
- data/plugins/guests/nixos/cap/change_host_name.rb +11 -8
- data/plugins/guests/nixos/cap/configure_networks.rb +12 -9
- data/plugins/guests/omnios/cap/change_host_name.rb +17 -5
- data/plugins/guests/omnios/cap/mount_nfs_folder.rb +10 -4
- data/plugins/guests/omnios/cap/rsync.rb +11 -0
- data/plugins/guests/omnios/guest.rb +0 -2
- data/plugins/guests/omnios/plugin.rb +6 -1
- data/plugins/guests/openbsd/cap/configure_networks.rb +8 -6
- data/plugins/guests/photon/cap/change_host_name.rb +17 -4
- data/plugins/guests/photon/cap/configure_networks.rb +14 -26
- data/plugins/guests/photon/guest.rb +1 -1
- data/plugins/guests/photon/plugin.rb +12 -12
- data/plugins/guests/pld/cap/change_host_name.rb +21 -9
- data/plugins/guests/pld/guest.rb +0 -2
- data/plugins/guests/pld/plugin.rb +1 -1
- data/plugins/guests/redhat/cap/change_host_name.rb +30 -96
- data/plugins/guests/redhat/cap/configure_networks.rb +44 -50
- data/plugins/guests/redhat/cap/flavor.rb +3 -4
- data/plugins/guests/redhat/cap/nfs_client.rb +13 -25
- data/plugins/guests/redhat/cap/rsync.rb +6 -6
- data/plugins/guests/redhat/guest.rb +0 -2
- data/plugins/guests/redhat/plugin.rb +1 -10
- data/plugins/guests/slackware/cap/change_host_name.rb +19 -8
- data/plugins/guests/slackware/cap/configure_networks.rb +30 -14
- data/plugins/guests/slackware/guest.rb +0 -2
- data/plugins/guests/slackware/plugin.rb +1 -1
- data/plugins/guests/smartos/config.rb +3 -15
- data/plugins/guests/suse/cap/change_host_name.rb +15 -7
- data/plugins/guests/suse/cap/configure_networks.rb +31 -37
- data/plugins/guests/suse/cap/nfs_client.rb +5 -6
- data/plugins/guests/suse/cap/rsync.rb +1 -3
- data/plugins/guests/suse/guest.rb +0 -2
- data/plugins/guests/suse/plugin.rb +1 -1
- data/plugins/guests/tinycore/cap/mount_nfs.rb +46 -0
- data/plugins/guests/tinycore/plugin.rb +5 -0
- data/plugins/guests/trisquel/guest.rb +9 -0
- data/plugins/guests/trisquel/plugin.rb +15 -0
- data/plugins/guests/ubuntu/cap/change_host_name.rb +42 -41
- data/plugins/guests/ubuntu/guest.rb +0 -2
- data/plugins/guests/ubuntu/plugin.rb +1 -3
- data/plugins/guests/windows/guest_network.rb +1 -1
- data/plugins/hosts/arch/cap/nfs.rb +3 -19
- data/plugins/hosts/darwin/cap/provider_install_virtualbox.rb +4 -5
- data/plugins/hosts/darwin/cap/rdp.rb +34 -6
- data/plugins/hosts/gentoo/cap/nfs.rb +1 -1
- data/plugins/hosts/windows/cap/provider_install_virtualbox.rb +4 -5
- data/plugins/hosts/windows/cap/ps.rb +2 -2
- data/plugins/hosts/windows/cap/rdp.rb +8 -17
- data/plugins/kernel_v2/config/ssh_connect.rb +6 -0
- data/plugins/kernel_v2/config/vm.rb +3 -1
- data/plugins/providers/docker/action.rb +3 -3
- data/plugins/providers/docker/action/create.rb +1 -1
- data/plugins/providers/docker/command/exec.rb +104 -0
- data/plugins/providers/docker/config.rb +9 -1
- data/plugins/providers/docker/errors.rb +4 -0
- data/plugins/providers/docker/plugin.rb +6 -0
- data/plugins/providers/docker/provider.rb +1 -2
- data/plugins/providers/hyperv/action.rb +56 -1
- data/plugins/providers/hyperv/action/import.rb +13 -5
- data/plugins/providers/hyperv/action/snapshot_delete.rb +27 -0
- data/plugins/providers/hyperv/action/snapshot_restore.rb +23 -0
- data/plugins/providers/hyperv/action/snapshot_save.rb +27 -0
- data/plugins/providers/hyperv/cap/snapshot_list.rb +11 -0
- data/plugins/providers/hyperv/config.rb +5 -2
- data/plugins/providers/hyperv/driver.rb +18 -1
- data/plugins/providers/hyperv/plugin.rb +5 -0
- data/plugins/providers/hyperv/scripts/clone_vhd.ps1 +9 -0
- data/plugins/providers/hyperv/scripts/create_snapshot.ps1 +8 -0
- data/plugins/providers/hyperv/scripts/delete_snapshot.ps1 +8 -0
- data/plugins/providers/hyperv/scripts/get_vm_status.ps1 +8 -2
- data/plugins/providers/hyperv/scripts/import_vm.ps1 +5 -1
- data/plugins/providers/hyperv/scripts/list_snapshots.ps1 +12 -0
- data/plugins/providers/hyperv/scripts/restore_snapshot.ps1 +8 -0
- data/plugins/providers/virtualbox/action.rb +9 -4
- data/plugins/providers/virtualbox/action/import_master.rb +81 -75
- data/plugins/providers/virtualbox/action/package.rb +1 -29
- data/plugins/providers/virtualbox/action/package_setup_files.rb +51 -0
- data/plugins/providers/virtualbox/action/package_setup_folders.rb +38 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +23 -1
- data/plugins/providers/virtualbox/action/setup_package_files.rb +9 -43
- data/plugins/providers/virtualbox/driver/version_4_1.rb +104 -6
- data/plugins/providers/virtualbox/driver/version_4_2.rb +6 -5
- data/plugins/providers/virtualbox/driver/version_4_3.rb +6 -5
- data/plugins/providers/virtualbox/driver/version_5_0.rb +6 -5
- data/plugins/provisioners/ansible/cap/guest/arch/ansible_install.rb +8 -3
- data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +26 -4
- data/plugins/provisioners/ansible/cap/guest/facts.rb +24 -0
- data/plugins/provisioners/ansible/cap/guest/fedora/ansible_install.rb +16 -6
- data/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install.rb +7 -2
- data/plugins/provisioners/ansible/cap/guest/pip/pip.rb +28 -0
- data/plugins/provisioners/ansible/cap/guest/posix/ansible_installed.rb +1 -1
- data/plugins/provisioners/ansible/cap/guest/redhat/ansible_install.rb +24 -7
- data/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb +6 -2
- data/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb +17 -6
- data/plugins/provisioners/ansible/config/base.rb +15 -23
- data/plugins/provisioners/ansible/config/guest.rb +9 -22
- data/plugins/provisioners/ansible/config/host.rb +9 -19
- data/plugins/provisioners/ansible/errors.rb +4 -0
- data/plugins/provisioners/ansible/helpers.rb +4 -24
- data/plugins/provisioners/ansible/provisioner/base.rb +58 -10
- data/plugins/provisioners/ansible/provisioner/guest.rb +55 -22
- data/plugins/provisioners/ansible/provisioner/host.rb +50 -9
- data/plugins/provisioners/chef/cap/linux/chef_installed.rb +2 -2
- data/plugins/provisioners/chef/cap/omnios/chef_installed.rb +3 -3
- data/plugins/provisioners/chef/cap/redhat/chef_install.rb +7 -11
- data/plugins/provisioners/chef/cap/suse/chef_install.rb +27 -0
- data/plugins/provisioners/chef/cap/windows/chef_installed.rb +1 -1
- data/plugins/provisioners/chef/command_builder.rb +1 -0
- data/plugins/provisioners/chef/config/base.rb +5 -6
- data/plugins/provisioners/chef/config/chef_solo.rb +6 -0
- data/plugins/provisioners/chef/installer.rb +2 -2
- data/plugins/provisioners/chef/omnibus.rb +1 -1
- data/plugins/provisioners/chef/plugin.rb +5 -0
- data/plugins/provisioners/chef/provisioner/base.rb +52 -56
- data/plugins/provisioners/chef/provisioner/chef_apply.rb +9 -10
- data/plugins/provisioners/chef/provisioner/chef_client.rb +1 -1
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +1 -0
- data/plugins/provisioners/docker/client.rb +22 -4
- data/plugins/provisioners/puppet/provisioner/puppet.rb +3 -3
- data/plugins/provisioners/salt/provisioner.rb +19 -24
- data/plugins/pushes/ftp/adapter.rb +18 -1
- data/plugins/pushes/heroku/locales/en.yml +1 -1
- data/plugins/synced_folders/rsync/helper.rb +1 -1
- data/templates/commands/init/Vagrantfile.erb +6 -3
- data/templates/commands/init/Vagrantfile.min.erb +1 -1
- data/templates/commands/ssh_config/config.erb +5 -1
- data/templates/guests/debian/network_dhcp.erb +2 -2
- data/templates/guests/debian/network_static.erb +2 -2
- data/templates/guests/debian/network_static6.erb +2 -2
- data/templates/guests/fedora/network_static6.erb +9 -0
- data/templates/guests/freebsd/network_dhcp.erb +2 -1
- data/templates/guests/freebsd/network_static.erb +1 -1
- data/templates/guests/slackware/network_dhcp.erb +8 -20
- data/templates/guests/slackware/network_static.erb +10 -22
- data/templates/guests/suse/network_dhcp.erb +1 -1
- data/templates/guests/suse/network_static.erb +3 -3
- data/templates/locales/en.yml +35 -18
- data/templates/locales/providers_docker.yml +8 -0
- data/templates/provisioners/chef_solo/solo.erb +7 -7
- data/test/support/isolated_environment.rb +1 -1
- data/test/unit/base.rb +9 -1
- data/test/unit/plugins/commands/box/command/update_test.rb +7 -1
- data/test/unit/plugins/commands/init/command_test.rb +86 -0
- data/test/unit/plugins/commands/login/client_test.rb +7 -0
- data/test/unit/plugins/commands/ssh_config/command_test.rb +2 -14
- data/test/unit/plugins/communicators/winrm/shell_test.rb +40 -16
- data/test/unit/plugins/guests/amazon/cap/flavor_test.rb +19 -0
- data/test/unit/plugins/guests/arch/cap/change_host_name_test.rb +38 -0
- data/test/unit/plugins/guests/arch/cap/configure_networks_test.rb +55 -0
- data/test/unit/plugins/guests/atomic/cap/change_host_name_test.rb +38 -0
- data/test/unit/plugins/guests/atomic/cap/docker_test.rb +28 -0
- data/test/unit/plugins/guests/coreos/cap/change_host_name_test.rb +37 -0
- data/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb +59 -0
- data/test/unit/plugins/guests/coreos/cap/docker_test.rb +28 -0
- data/test/unit/plugins/guests/darwin/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/darwin/cap/choose_addressable_ip_addr_test.rb +36 -0
- data/test/unit/plugins/guests/debian/cap/change_host_name_test.rb +23 -16
- data/test/unit/plugins/guests/debian/cap/configure_networks_test.rb +54 -0
- data/test/unit/plugins/guests/debian/cap/nfs_client_test.rb +30 -0
- data/test/unit/plugins/guests/debian/cap/rsync_test.rb +38 -0
- data/test/unit/plugins/guests/debian/cap/smb_test.rb +38 -0
- data/test/unit/plugins/guests/freebsd/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +51 -0
- data/test/unit/plugins/guests/freebsd/cap/halt_test.rb +35 -0
- data/test/unit/plugins/guests/freebsd/cap/insert_public_key_test.rb +31 -0
- data/test/unit/plugins/guests/freebsd/cap/mount_nfs_folder_test.rb +53 -0
- data/test/unit/plugins/guests/freebsd/cap/rsync_test.rb +46 -0
- data/test/unit/plugins/guests/linux/cap/choose_addressable_ip_addr_test.rb +38 -0
- data/test/unit/plugins/guests/linux/cap/halt_test.rb +36 -0
- data/test/unit/plugins/guests/linux/cap/insert_public_key_test.rb +32 -0
- data/test/unit/plugins/guests/linux/cap/mount_nfs_test.rb +78 -0
- data/test/unit/plugins/guests/linux/cap/mount_shared_folder_test.rb +1 -1
- data/test/unit/plugins/guests/linux/cap/nfs_client_test.rb +29 -0
- data/test/unit/plugins/guests/linux/cap/port_test.rb +30 -0
- data/test/unit/plugins/guests/omnios/cap/change_host_name_test.rb +41 -0
- data/test/unit/plugins/guests/omnios/cap/mount_nfs_folder_test.rb +47 -0
- data/test/unit/plugins/guests/omnios/cap/rsync_test.rb +29 -0
- data/test/unit/plugins/guests/photon/cap/change_host_name_test.rb +26 -18
- data/test/unit/plugins/guests/photon/cap/configure_networks_test.rb +37 -26
- data/test/unit/plugins/guests/photon/cap/docker_test.rb +17 -12
- data/test/unit/plugins/guests/pld/cap/change_host_name_test.rb +39 -0
- data/test/unit/plugins/guests/pld/cap/flavor_test.rb +21 -0
- data/test/unit/plugins/guests/pld/cap/network_scripts_dir_test.rb +21 -0
- data/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +23 -51
- data/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb +80 -0
- data/test/unit/plugins/guests/redhat/cap/flavor_test.rb +40 -0
- data/test/unit/plugins/guests/redhat/cap/network_scripts_dir_test.rb +21 -0
- data/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb +30 -0
- data/test/unit/plugins/guests/redhat/cap/rsync_test.rb +29 -0
- data/test/unit/plugins/guests/slackware/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb +48 -0
- data/test/unit/plugins/guests/smartos/cap/change_host_name_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/configure_networks_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/halt_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/rsync_test.rb +1 -1
- data/test/unit/plugins/guests/suse/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/suse/cap/configure_networks_test.rb +60 -0
- data/test/unit/plugins/guests/suse/cap/halt_test.rb +36 -0
- data/test/unit/plugins/guests/suse/cap/network_scripts_dir_test.rb +19 -0
- data/test/unit/plugins/guests/suse/cap/nfs_client_test.rb +31 -0
- data/test/unit/plugins/guests/suse/cap/rsync_test.rb +38 -0
- data/test/unit/plugins/guests/tinycore/cap/change_host_name_test.rb +1 -1
- data/test/unit/plugins/guests/ubuntu/cap/change_host_name_test.rb +24 -16
- data/test/unit/plugins/guests/windows/cap/change_host_name_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/halt_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/reboot_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/rsync_test.rb +1 -1
- data/test/unit/plugins/hosts/darwin/cap/rdp_test.rb +36 -0
- data/test/unit/plugins/kernel_v2/config/vm_test.rb +27 -1
- data/test/unit/plugins/providers/docker/action/create_test.rb +55 -0
- data/test/unit/plugins/providers/docker/command/exec_test.rb +44 -0
- data/test/unit/plugins/providers/docker/config_test.rb +7 -2
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +18 -0
- data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +83 -0
- data/test/unit/plugins/provisioners/ansible/config/host_test.rb +98 -0
- data/test/unit/plugins/provisioners/ansible/config/shared.rb +107 -0
- data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +82 -10
- data/test/unit/plugins/provisioners/chef/config/base_test.rb +2 -2
- data/test/unit/plugins/provisioners/chef/provisioner/base_test.rb +29 -0
- data/test/unit/plugins/pushes/atlas/push_test.rb +12 -8
- data/test/unit/plugins/pushes/ftp/adapter_test.rb +1 -1
- data/test/unit/plugins/pushes/ftp/push_test.rb +5 -4
- data/test/unit/support/isolated_environment.rb +4 -4
- data/test/unit/support/shared/base_context.rb +11 -3
- data/test/unit/templates/guests/arch/network_dhcp_test.rb +2 -2
- data/test/unit/templates/guests/arch/network_static_test.rb +4 -4
- data/test/unit/templates/guests/debian/network_dhcp_test.rb +6 -6
- data/test/unit/templates/guests/debian/network_static_test.rb +6 -6
- data/test/unit/templates/guests/fedora/network_static6_test.rb +25 -0
- data/test/unit/templates/guests/freebsd/network_dhcp_test.rb +5 -2
- data/test/unit/templates/guests/freebsd/network_static_test.rb +13 -17
- data/test/unit/templates/guests/suse/network_dhcp_test.rb +2 -2
- data/test/unit/templates/guests/suse/network_static_test.rb +4 -4
- data/test/unit/vagrant/action/builtin/box_add_test.rb +33 -31
- data/test/unit/vagrant/action/builtin/lock_test.rb +5 -2
- data/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb +6 -2
- data/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +5 -1
- data/test/unit/vagrant/action/builtin/synced_folders_test.rb +5 -1
- data/test/unit/vagrant/box_collection_test.rb +19 -7
- data/test/unit/vagrant/box_test.rb +13 -2
- data/test/unit/vagrant/config_test.rb +1 -1
- data/test/unit/vagrant/environment_test.rb +16 -12
- data/test/unit/vagrant/machine_index_test.rb +5 -1
- data/test/unit/vagrant/machine_test.rb +5 -1
- data/test/unit/vagrant/plugin/manager_test.rb +1 -5
- data/test/unit/vagrant/plugin/state_file_test.rb +1 -5
- data/test/unit/vagrant/util/platform_test.rb +5 -0
- data/test/unit/vagrant/util/safe_chdir_test.rb +11 -5
- data/test/unit/vagrant/vagrantfile_test.rb +5 -1
- data/vagrant.gemspec +8 -3
- data/version.txt +1 -1
- metadata +3657 -12
- data/CONTRIBUTING.md +0 -41
- data/test/unit/plugins/guests/support/shared/debian_like_host_name_examples.rb +0 -106
- data/test/unit/plugins/guests/support/shared/redhat_like_host_name_examples.rb +0 -252
- data/test/unit/plugins/provisioners/ansible/config_test.rb +0 -224
@@ -7,13 +7,11 @@ module VagrantPlugins
|
|
7
7
|
description "Ubuntu guest support."
|
8
8
|
|
9
9
|
guest("ubuntu", "debian") do
|
10
|
-
|
10
|
+
require_relative "guest"
|
11
11
|
Guest
|
12
12
|
end
|
13
13
|
|
14
14
|
guest_capability("ubuntu", "change_host_name") do
|
15
|
-
# ubuntu is just just a specialization of the debian code for this capability
|
16
|
-
require_relative "../debian/cap/change_host_name"
|
17
15
|
require_relative "cap/change_host_name"
|
18
16
|
Cap::ChangeHostName
|
19
17
|
end
|
@@ -92,7 +92,7 @@ module VagrantPlugins
|
|
92
92
|
@logger.debug("querying network adapters")
|
93
93
|
|
94
94
|
# Get all NICs that have a MAC address
|
95
|
-
#
|
95
|
+
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspx
|
96
96
|
adapters = @communicator.execute(WQL_NET_ADAPTERS_V2, { shell: :wql } )[:win32_network_adapter]
|
97
97
|
@logger.debug("#{adapters.inspect}")
|
98
98
|
return adapters
|
@@ -3,31 +3,15 @@ module VagrantPlugins
|
|
3
3
|
module Cap
|
4
4
|
class NFS
|
5
5
|
def self.nfs_check_command(env)
|
6
|
-
|
7
|
-
return "/usr/sbin/systemctl status nfs-server.service"
|
8
|
-
else
|
9
|
-
return "/etc/rc.d/nfs-server status"
|
10
|
-
end
|
6
|
+
return "/usr/sbin/systemctl status --no-pager nfs-server.service"
|
11
7
|
end
|
12
8
|
|
13
9
|
def self.nfs_start_command(env)
|
14
|
-
|
15
|
-
return "/usr/sbin/systemctl start nfs-server.service"
|
16
|
-
else
|
17
|
-
return "sh -c 'for s in {rpcbind,nfs-common,nfs-server}; do /etc/rc.d/$s start; done'"
|
18
|
-
end
|
10
|
+
return "/usr/sbin/systemctl start nfs-server.service"
|
19
11
|
end
|
20
12
|
|
21
13
|
def self.nfs_installed(environment)
|
22
|
-
Kernel.system("grep -Fq
|
23
|
-
end
|
24
|
-
|
25
|
-
protected
|
26
|
-
|
27
|
-
# This tests to see if systemd is used on the system. This is used
|
28
|
-
# in newer versions of Arch, and requires a change in behavior.
|
29
|
-
def self.systemd?
|
30
|
-
`ps -o comm= 1`.chomp == 'systemd'
|
14
|
+
Kernel.system("grep -Fq nfsd /proc/filesystems")
|
31
15
|
end
|
32
16
|
end
|
33
17
|
end
|
@@ -16,8 +16,7 @@ module VagrantPlugins
|
|
16
16
|
SHA256SUM = "62f933115498e51ddf5f2dab47dc1eebb42eb78ea1a7665cb91c53edacc847c6".freeze
|
17
17
|
|
18
18
|
def self.provider_install_virtualbox(env)
|
19
|
-
|
20
|
-
tf.close
|
19
|
+
path = Dir::Tmpname.create("vagrant-provider-install-virtualbox") {}
|
21
20
|
|
22
21
|
# Prefixed UI for prettiness
|
23
22
|
ui = Vagrant::UI::Prefixed.new(env.ui, "")
|
@@ -28,11 +27,11 @@ module VagrantPlugins
|
|
28
27
|
version: VERSION))
|
29
28
|
ui.detail(I18n.t(
|
30
29
|
"vagrant.hosts.darwin.virtualbox_install_detail"))
|
31
|
-
dl = Vagrant::Util::Downloader.new(URL,
|
30
|
+
dl = Vagrant::Util::Downloader.new(URL, path, ui: ui)
|
32
31
|
dl.download!
|
33
32
|
|
34
33
|
# Validate that the file checksum matches
|
35
|
-
actual = FileChecksum.new(
|
34
|
+
actual = FileChecksum.new(path, Digest::SHA2).checksum
|
36
35
|
if actual != SHA256SUM
|
37
36
|
raise Vagrant::Errors::ProviderChecksumMismatch,
|
38
37
|
provider: "virtualbox",
|
@@ -46,7 +45,7 @@ module VagrantPlugins
|
|
46
45
|
ui.detail(I18n.t(
|
47
46
|
"vagrant.hosts.darwin.virtualbox_install_install_detail"))
|
48
47
|
script = File.expand_path("../../scripts/install_virtualbox.sh", __FILE__)
|
49
|
-
result = Vagrant::Util::Subprocess.execute("bash", script,
|
48
|
+
result = Vagrant::Util::Subprocess.execute("bash", script, path)
|
50
49
|
if result.exit_code != 0
|
51
50
|
raise Vagrant::Errors::ProviderInstallFailed,
|
52
51
|
provider: "virtualbox",
|
@@ -8,6 +8,26 @@ module VagrantPlugins
|
|
8
8
|
module Cap
|
9
9
|
class RDP
|
10
10
|
def self.rdp_client(env, rdp_info)
|
11
|
+
config_path = self.generate_config_file(rdp_info)
|
12
|
+
begin
|
13
|
+
Vagrant::Util::Subprocess.execute("open", config_path.to_s)
|
14
|
+
ensure
|
15
|
+
# Note: this technically will never get run; neither would an
|
16
|
+
# at_exit call. The reason is that `exec` replaces this process,
|
17
|
+
# effectively the same as `kill -9`. This is solely here to prove
|
18
|
+
# that and so that future developers do not waste a ton of time
|
19
|
+
# try to identify why Vagrant is leaking RDP connection files.
|
20
|
+
# There is a catch-22 here in that we can't delete the file before
|
21
|
+
# we exec, and we can't delete the file after we exec :(.
|
22
|
+
File.unlink(config_path) if File.file?(config_path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
# Generates an RDP connection file and returns the resulting path.
|
29
|
+
# @return [String]
|
30
|
+
def self.generate_config_file(rdp_info)
|
11
31
|
opts = {
|
12
32
|
"drivestoredirect:s" => "*",
|
13
33
|
"full address:s" => "#{rdp_info[:host]}:#{rdp_info[:port]}",
|
@@ -16,16 +36,24 @@ module VagrantPlugins
|
|
16
36
|
}
|
17
37
|
|
18
38
|
# Create the ".rdp" file
|
19
|
-
|
20
|
-
|
21
|
-
|
39
|
+
t = ::Tempfile.new(["vagrant-rdp", ".rdp"]).tap do |f|
|
40
|
+
f.binmode
|
41
|
+
|
22
42
|
opts.each do |k, v|
|
23
|
-
f.
|
43
|
+
f.write("#{k}:#{v}")
|
44
|
+
end
|
45
|
+
|
46
|
+
if rdp_info[:extra_args]
|
47
|
+
rdp_info[:extra_args].each do |arg|
|
48
|
+
f.write("#{arg}")
|
49
|
+
end
|
24
50
|
end
|
51
|
+
|
52
|
+
f.fsync
|
53
|
+
f.close
|
25
54
|
end
|
26
55
|
|
27
|
-
|
28
|
-
Vagrant::Util::Subprocess.execute("open", config_path.to_s)
|
56
|
+
return t.path
|
29
57
|
end
|
30
58
|
end
|
31
59
|
end
|
@@ -17,8 +17,7 @@ module VagrantPlugins
|
|
17
17
|
SHA256SUM = "3e5ed8fe4ada6eef8dfb4fe6fd79fcab4b242acf799f7d3ab4a17b43838b1e04".freeze
|
18
18
|
|
19
19
|
def self.provider_install_virtualbox(env)
|
20
|
-
|
21
|
-
tf.close
|
20
|
+
path = Dir::Tmpname.create("vagrant-provider-install-virtualbox") {}
|
22
21
|
|
23
22
|
# Prefixed UI for prettiness
|
24
23
|
ui = Vagrant::UI::Prefixed.new(env.ui, "")
|
@@ -29,11 +28,11 @@ module VagrantPlugins
|
|
29
28
|
version: VERSION))
|
30
29
|
ui.detail(I18n.t(
|
31
30
|
"vagrant.hosts.windows.virtualbox_install_detail"))
|
32
|
-
dl = Vagrant::Util::Downloader.new(URL,
|
31
|
+
dl = Vagrant::Util::Downloader.new(URL, path, ui: ui)
|
33
32
|
dl.download!
|
34
33
|
|
35
34
|
# Validate that the file checksum matches
|
36
|
-
actual = FileChecksum.new(
|
35
|
+
actual = FileChecksum.new(path, Digest::SHA2).checksum
|
37
36
|
if actual != SHA256SUM
|
38
37
|
raise Vagrant::Errors::ProviderChecksumMismatch,
|
39
38
|
provider: "virtualbox",
|
@@ -47,7 +46,7 @@ module VagrantPlugins
|
|
47
46
|
ui.detail(I18n.t(
|
48
47
|
"vagrant.hosts.windows.virtualbox_install_install_detail"))
|
49
48
|
script = File.expand_path("../../scripts/install_virtualbox.ps1", __FILE__)
|
50
|
-
result = Vagrant::Util::PowerShell.execute(script,
|
49
|
+
result = Vagrant::Util::PowerShell.execute(script, path)
|
51
50
|
if result.exit_code != 0
|
52
51
|
raise Vagrant::Errors::ProviderInstallFailed,
|
53
52
|
provider: "virtualbox",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "pathname"
|
2
2
|
require "tmpdir"
|
3
3
|
|
4
|
-
require "vagrant/util/
|
4
|
+
require "vagrant/util/safe_exec"
|
5
5
|
|
6
6
|
module VagrantPlugins
|
7
7
|
module HostWindows
|
@@ -34,7 +34,7 @@ module VagrantPlugins
|
|
34
34
|
end
|
35
35
|
|
36
36
|
# Launch it
|
37
|
-
Vagrant::Util::
|
37
|
+
Vagrant::Util::SafeExec.exec("powershell", *args)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -8,28 +8,19 @@ module VagrantPlugins
|
|
8
8
|
module Cap
|
9
9
|
class RDP
|
10
10
|
def self.rdp_client(env, rdp_info)
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
|
17
|
-
|
18
|
-
# Create the ".rdp" file
|
19
|
-
config_path = Pathname.new(Dir.tmpdir).join(
|
20
|
-
"vagrant-rdp-#{Time.now.to_i}-#{rand(10000)}.rdp")
|
21
|
-
config_path.open("w+") do |f|
|
22
|
-
opts.each do |k, v|
|
23
|
-
f.puts("#{k}:#{v}")
|
24
|
-
end
|
25
|
-
end
|
11
|
+
# Setup password
|
12
|
+
cmdKeyArgs = [
|
13
|
+
"/add:#{rdp_info[:host]}:#{rdp_info[:port]}",
|
14
|
+
"/user:#{rdp_info[:username]}",
|
15
|
+
"/pass:#{rdp_info[:password]}",
|
16
|
+
]
|
17
|
+
Vagrant::Util::Subprocess.execute("cmdkey", *cmdKeyArgs)
|
26
18
|
|
27
19
|
# Build up the args to mstsc
|
28
|
-
args = [
|
20
|
+
args = ["/v:#{rdp_info[:host]}:#{rdp_info[:port]}"]
|
29
21
|
if rdp_info[:extra_args]
|
30
22
|
args = rdp_info[:extra_args] + args
|
31
23
|
end
|
32
|
-
|
33
24
|
# Launch it
|
34
25
|
Vagrant::Util::Subprocess.execute("mstsc", *args)
|
35
26
|
end
|
@@ -7,6 +7,8 @@ module VagrantPlugins
|
|
7
7
|
attr_accessor :username
|
8
8
|
attr_accessor :password
|
9
9
|
attr_accessor :insert_key
|
10
|
+
attr_accessor :keys_only
|
11
|
+
attr_accessor :paranoid
|
10
12
|
|
11
13
|
def initialize
|
12
14
|
@host = UNSET_VALUE
|
@@ -15,6 +17,8 @@ module VagrantPlugins
|
|
15
17
|
@username = UNSET_VALUE
|
16
18
|
@password = UNSET_VALUE
|
17
19
|
@insert_key = UNSET_VALUE
|
20
|
+
@keys_only = UNSET_VALUE
|
21
|
+
@paranoid = UNSET_VALUE
|
18
22
|
end
|
19
23
|
|
20
24
|
def finalize!
|
@@ -24,6 +28,8 @@ module VagrantPlugins
|
|
24
28
|
@username = nil if @username == UNSET_VALUE
|
25
29
|
@password = nil if @password == UNSET_VALUE
|
26
30
|
@insert_key = true if @insert_key == UNSET_VALUE
|
31
|
+
@keys_only = true if @keys_only == UNSET_VALUE
|
32
|
+
@paranoid = false if @paranoid == UNSET_VALUE
|
27
33
|
|
28
34
|
if @private_key_path && !@private_key_path.is_a?(Array)
|
29
35
|
@private_key_path = [@private_key_path]
|
@@ -425,7 +425,9 @@ module VagrantPlugins
|
|
425
425
|
id: "winrm-ssl",
|
426
426
|
auto_correct: true
|
427
427
|
end
|
428
|
-
|
428
|
+
end
|
429
|
+
# forward SSH ports regardless of communicator
|
430
|
+
if !@__networks["forwarded_port-ssh"]
|
429
431
|
network :forwarded_port,
|
430
432
|
guest: 22,
|
431
433
|
host: 2222,
|
@@ -217,9 +217,6 @@ module VagrantPlugins
|
|
217
217
|
def self.action_start
|
218
218
|
Vagrant::Action::Builder.new.tap do |b|
|
219
219
|
b.use Call, IsState, :running do |env, b2|
|
220
|
-
# If the container is running and we're not doing a run, we're done
|
221
|
-
next if env[:result] && env[:machine_action] != :run_command
|
222
|
-
|
223
220
|
if env[:machine_action] != :run_command
|
224
221
|
b2.use Call, HasSSH do |env2, b3|
|
225
222
|
if env2[:result]
|
@@ -232,6 +229,9 @@ module VagrantPlugins
|
|
232
229
|
end
|
233
230
|
end
|
234
231
|
|
232
|
+
# If the container is running and we're doing a run, we're done
|
233
|
+
next if env[:result] && env[:machine_action] != :run_command
|
234
|
+
|
235
235
|
b2.use Call, IsState, :not_created do |env2, b3|
|
236
236
|
if env2[:result]
|
237
237
|
# First time making this thing, set to the "preparing" state
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module DockerProvider
|
3
|
+
module Command
|
4
|
+
class Exec < Vagrant.plugin("2", :command)
|
5
|
+
def self.synopsis
|
6
|
+
"attach to an already-running docker container"
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
options = {}
|
11
|
+
options[:detach] = false
|
12
|
+
options[:pty] = false
|
13
|
+
options[:interactive] = false
|
14
|
+
options[:prefix] = true
|
15
|
+
|
16
|
+
opts = OptionParser.new do |o|
|
17
|
+
o.banner = "Usage: vagrant docker-exec [options] [name] -- <command> [args]"
|
18
|
+
o.separator ""
|
19
|
+
o.separator "Options:"
|
20
|
+
o.separator ""
|
21
|
+
|
22
|
+
o.on("--[no-]detach", "Run in the background") do |d|
|
23
|
+
options[:detach] = d
|
24
|
+
end
|
25
|
+
|
26
|
+
o.on("-i", "--[no-]interactive", "Keep STDIN open even if not attached") do |i|
|
27
|
+
options[:interactive] = i
|
28
|
+
end
|
29
|
+
|
30
|
+
o.on("-t", "--[no-]tty", "Allocate a pty") do |t|
|
31
|
+
options[:pty] = t
|
32
|
+
end
|
33
|
+
|
34
|
+
o.on("-u", "--user USER", "User or UID") do |u|
|
35
|
+
options[:user] = u
|
36
|
+
end
|
37
|
+
|
38
|
+
o.on("--[no-]prefix", "Prefix output with machine names") do |p|
|
39
|
+
options[:prefix] = p
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Parse out the extra args to send to SSH, which is everything
|
44
|
+
# after the "--"
|
45
|
+
command = nil
|
46
|
+
split_index = @argv.index("--")
|
47
|
+
if split_index
|
48
|
+
command = @argv.drop(split_index + 1)
|
49
|
+
@argv = @argv.take(split_index)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Parse the options
|
53
|
+
argv = parse_options(opts)
|
54
|
+
return if !argv
|
55
|
+
|
56
|
+
# Show the error if we don't have "--" _after_ parse_options
|
57
|
+
# so that "-h" and "--help" work properly.
|
58
|
+
if !split_index
|
59
|
+
raise Errors::ExecCommandRequired
|
60
|
+
end
|
61
|
+
|
62
|
+
target_opts = { provider: :docker }
|
63
|
+
target_opts[:single_target] = options[:pty]
|
64
|
+
|
65
|
+
with_target_vms(argv, target_opts) do |machine|
|
66
|
+
if machine.state.id != :running
|
67
|
+
@env.ui.info("#{machine.id} is not running.")
|
68
|
+
next
|
69
|
+
end
|
70
|
+
exec_command(machine, command, options)
|
71
|
+
end
|
72
|
+
|
73
|
+
return 0
|
74
|
+
end
|
75
|
+
|
76
|
+
def exec_command(machine, command, options)
|
77
|
+
exec_cmd = %w(docker exec)
|
78
|
+
exec_cmd << "-i" if options[:interactive]
|
79
|
+
exec_cmd << "-t" if options[:pty]
|
80
|
+
exec_cmd << "-u" << options[:user] if options[:user]
|
81
|
+
exec_cmd << machine.id
|
82
|
+
exec_cmd += options[:extra_args] if options[:extra_args]
|
83
|
+
exec_cmd += command
|
84
|
+
|
85
|
+
# Run this interactively if asked.
|
86
|
+
exec_options = options
|
87
|
+
exec_options[:stdin] = true if options[:pty]
|
88
|
+
|
89
|
+
output = ""
|
90
|
+
machine.provider.driver.execute(*exec_cmd, exec_options) do |type, data|
|
91
|
+
output += data
|
92
|
+
end
|
93
|
+
|
94
|
+
output_options = {}
|
95
|
+
output_options[:prefix] = false if !options[:prefix]
|
96
|
+
|
97
|
+
if !output.empty?
|
98
|
+
machine.ui.output(output.chomp, **output_options)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require "pathname"
|
2
2
|
|
3
|
+
require_relative "../../../lib/vagrant/util/platform"
|
4
|
+
|
3
5
|
module VagrantPlugins
|
4
6
|
module DockerProvider
|
5
7
|
class Config < Vagrant.plugin("2", :config)
|
@@ -202,7 +204,6 @@ module VagrantPlugins
|
|
202
204
|
@create_args = [] if @create_args == UNSET_VALUE
|
203
205
|
@dockerfile = nil if @dockerfile == UNSET_VALUE
|
204
206
|
@env ||= {}
|
205
|
-
@force_host_vm = false if @force_host_vm == UNSET_VALUE
|
206
207
|
@has_ssh = false if @has_ssh == UNSET_VALUE
|
207
208
|
@image = nil if @image == UNSET_VALUE
|
208
209
|
@name = nil if @name == UNSET_VALUE
|
@@ -223,6 +224,13 @@ module VagrantPlugins
|
|
223
224
|
@host_vm_build_dir_options = nil
|
224
225
|
end
|
225
226
|
|
227
|
+
# On non-linux platforms (where there is no native docker), force the
|
228
|
+
# host VM. Other users can optionally disable this by setting the
|
229
|
+
# value explicitly to false in their Vagrantfile.
|
230
|
+
if @force_host_vm == UNSET_VALUE
|
231
|
+
@force_host_vm = !Vagrant::Util::Platform.linux?
|
232
|
+
end
|
233
|
+
|
226
234
|
# The machine name must be a symbol
|
227
235
|
@vagrant_machine = @vagrant_machine.to_sym if @vagrant_machine
|
228
236
|
|