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
@@ -1,9 +1,12 @@
|
|
1
1
|
require "rest_client"
|
2
2
|
require "vagrant/util/downloader"
|
3
|
+
require "vagrant/util/presence"
|
3
4
|
|
4
5
|
module VagrantPlugins
|
5
6
|
module LoginCommand
|
6
7
|
class Client
|
8
|
+
include Vagrant::Util::Presence
|
9
|
+
|
7
10
|
# Initializes a login client with the given Vagrant::Environment.
|
8
11
|
#
|
9
12
|
# @param [Vagrant::Environment] env
|
@@ -50,6 +53,7 @@ module VagrantPlugins
|
|
50
53
|
proxy = nil
|
51
54
|
proxy ||= ENV["HTTPS_PROXY"] || ENV["https_proxy"]
|
52
55
|
proxy ||= ENV["HTTP_PROXY"] || ENV["http_proxy"]
|
56
|
+
RestClient.proxy = proxy
|
53
57
|
|
54
58
|
response = RestClient::Request.execute(
|
55
59
|
method: :post,
|
@@ -87,7 +91,21 @@ module VagrantPlugins
|
|
87
91
|
#
|
88
92
|
# @return [String]
|
89
93
|
def token
|
90
|
-
if ENV["ATLAS_TOKEN"] &&
|
94
|
+
if present?(ENV["ATLAS_TOKEN"]) && token_path.exist?
|
95
|
+
@env.ui.warn <<-EOH.strip
|
96
|
+
Vagrant detected both the ATLAS_TOKEN environment variable and a Vagrant login
|
97
|
+
token are present on this system. The ATLAS_TOKEN environment variable takes
|
98
|
+
precedence over the locally stored token. To remove this error, either unset
|
99
|
+
the ATLAS_TOKEN environment variable or remove the login token stored on disk:
|
100
|
+
|
101
|
+
~/.vagrant.d/data/vagrant_login_token
|
102
|
+
|
103
|
+
In general, the ATLAS_TOKEN is more preferred because it is respected by all
|
104
|
+
HashiCorp products.
|
105
|
+
EOH
|
106
|
+
end
|
107
|
+
|
108
|
+
if present?(ENV["ATLAS_TOKEN"])
|
91
109
|
@logger.debug("Using authentication token from environment variable")
|
92
110
|
return ENV["ATLAS_TOKEN"]
|
93
111
|
end
|
@@ -43,7 +43,7 @@ module VagrantPlugins
|
|
43
43
|
# Clear the sources so that installation uses custom sources
|
44
44
|
old_sources = Gem.sources
|
45
45
|
Gem.sources = Gem.default_sources
|
46
|
-
Gem.sources << "
|
46
|
+
Gem.sources << "https://gems.hashicorp.com"
|
47
47
|
|
48
48
|
# Use a silent UI so that we have no output
|
49
49
|
Gem::DefaultUserInteraction.use_ui(Gem::SilentUI.new) do
|
@@ -11,7 +11,7 @@ module VagrantPlugins
|
|
11
11
|
options = {}
|
12
12
|
|
13
13
|
opts = OptionParser.new do |o|
|
14
|
-
o.banner = "Usage: vagrant rdp [options] [name] [-- extra args]"
|
14
|
+
o.banner = "Usage: vagrant rdp [options] [name|id] [-- extra args]"
|
15
15
|
end
|
16
16
|
|
17
17
|
# Parse out the extra args to send to the RDP client, which
|
@@ -1,24 +1,38 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
|
3
|
+
require Vagrant.source_root.join("plugins/commands/up/start_mixins")
|
4
|
+
|
3
5
|
module VagrantPlugins
|
4
6
|
module CommandResume
|
5
7
|
class Command < Vagrant.plugin("2", :command)
|
8
|
+
# We assume that the `up` plugin exists and that we'll have access
|
9
|
+
# to this.
|
10
|
+
include VagrantPlugins::CommandUp::StartMixins
|
11
|
+
|
6
12
|
def self.synopsis
|
7
13
|
"resume a suspended vagrant machine"
|
8
14
|
end
|
9
15
|
|
10
16
|
def execute
|
17
|
+
options = {}
|
18
|
+
options[:provision_ignore_sentinel] = false
|
19
|
+
|
11
20
|
opts = OptionParser.new do |o|
|
12
21
|
o.banner = "Usage: vagrant resume [vm-name]"
|
22
|
+
o.separator ""
|
23
|
+
build_start_options(o, options)
|
13
24
|
end
|
14
25
|
|
15
26
|
# Parse the options
|
16
27
|
argv = parse_options(opts)
|
17
28
|
return if !argv
|
18
29
|
|
30
|
+
# Validate the provisioners
|
31
|
+
validate_provisioner_flags!(options, argv)
|
32
|
+
|
19
33
|
@logger.debug("'resume' each target VM...")
|
20
34
|
with_target_vms(argv) do |machine|
|
21
|
-
machine.action(:resume)
|
35
|
+
machine.action(:resume, options)
|
22
36
|
end
|
23
37
|
|
24
38
|
# Success, exit status 0
|
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'optparse'
|
3
3
|
|
4
|
+
require 'vagrant'
|
5
|
+
|
6
|
+
require Vagrant.source_root.join("plugins/commands/up/start_mixins")
|
7
|
+
|
4
8
|
require_relative "push_shared"
|
5
9
|
|
6
10
|
module VagrantPlugins
|
@@ -8,19 +12,30 @@ module VagrantPlugins
|
|
8
12
|
module Command
|
9
13
|
class Pop < Vagrant.plugin("2", :command)
|
10
14
|
include PushShared
|
15
|
+
include VagrantPlugins::CommandUp::StartMixins
|
11
16
|
|
12
17
|
def execute
|
18
|
+
options = {}
|
19
|
+
options[:snapshot_delete] = true
|
13
20
|
opts = OptionParser.new do |o|
|
14
21
|
o.banner = "Usage: vagrant snapshot pop [options] [vm-name]"
|
15
22
|
o.separator ""
|
23
|
+
build_start_options(o, options)
|
16
24
|
o.separator "Restore state that was pushed with `vagrant snapshot push`."
|
25
|
+
|
26
|
+
o.on("--no-delete", "Don't delete the snapshot after the restore") do
|
27
|
+
options[:snapshot_delete] = false
|
28
|
+
end
|
17
29
|
end
|
18
30
|
|
19
31
|
# Parse the options
|
20
32
|
argv = parse_options(opts)
|
21
33
|
return if !argv
|
22
34
|
|
23
|
-
|
35
|
+
# Validate the provisioners
|
36
|
+
validate_provisioner_flags!(options, argv)
|
37
|
+
|
38
|
+
return shared_exec(argv, method(:pop), options)
|
24
39
|
end
|
25
40
|
end
|
26
41
|
end
|
@@ -4,7 +4,7 @@ module VagrantPlugins
|
|
4
4
|
module CommandSnapshot
|
5
5
|
module Command
|
6
6
|
module PushShared
|
7
|
-
def shared_exec(argv, m)
|
7
|
+
def shared_exec(argv, m, opts={})
|
8
8
|
with_target_vms(argv) do |vm|
|
9
9
|
if !vm.id
|
10
10
|
vm.ui.info("Not created. Cannot push snapshot state.")
|
@@ -12,7 +12,7 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
vm.env.lock("machine-snapshot-stack") do
|
15
|
-
m.call(vm)
|
15
|
+
m.call(vm, opts)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -20,14 +20,14 @@ module VagrantPlugins
|
|
20
20
|
0
|
21
21
|
end
|
22
22
|
|
23
|
-
def push(machine)
|
23
|
+
def push(machine, opts={})
|
24
24
|
snapshot_name = "push_#{Time.now.to_i}_#{rand(10000)}"
|
25
25
|
|
26
26
|
# Save the snapshot. This will raise an exception if it fails.
|
27
27
|
machine.action(:snapshot_save, snapshot_name: snapshot_name)
|
28
28
|
end
|
29
29
|
|
30
|
-
def pop(machine)
|
30
|
+
def pop(machine, opts={})
|
31
31
|
# By reverse sorting, we should be able to find the first
|
32
32
|
# pushed snapshot.
|
33
33
|
name = nil
|
@@ -45,11 +45,9 @@ module VagrantPlugins
|
|
45
45
|
return
|
46
46
|
end
|
47
47
|
|
48
|
-
# Restore the snapshot and tell the provider to delete it
|
49
|
-
|
50
|
-
|
51
|
-
snapshot_name: name,
|
52
|
-
snapshot_delete: true)
|
48
|
+
# Restore the snapshot and tell the provider to delete it, if required
|
49
|
+
opts[:snapshot_name] = name
|
50
|
+
machine.action(:snapshot_restore, opts)
|
53
51
|
end
|
54
52
|
end
|
55
53
|
end
|
@@ -1,15 +1,23 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
|
3
|
+
require 'vagrant'
|
4
|
+
|
5
|
+
require Vagrant.source_root.join("plugins/commands/up/start_mixins")
|
6
|
+
|
3
7
|
module VagrantPlugins
|
4
8
|
module CommandSnapshot
|
5
9
|
module Command
|
6
10
|
class Restore < Vagrant.plugin("2", :command)
|
11
|
+
|
12
|
+
include VagrantPlugins::CommandUp::StartMixins
|
13
|
+
|
7
14
|
def execute
|
8
15
|
options = {}
|
9
16
|
|
10
17
|
opts = OptionParser.new do |o|
|
11
18
|
o.banner = "Usage: vagrant snapshot restore [options] [vm-name] <name>"
|
12
19
|
o.separator ""
|
20
|
+
build_start_options(o, options)
|
13
21
|
o.separator "Restore a snapshot taken previously with snapshot save."
|
14
22
|
end
|
15
23
|
|
@@ -21,9 +29,14 @@ module VagrantPlugins
|
|
21
29
|
help: opts.help.chomp
|
22
30
|
end
|
23
31
|
|
32
|
+
# Validate the provisioners
|
33
|
+
validate_provisioner_flags!(options, argv)
|
34
|
+
|
24
35
|
name = argv.pop
|
36
|
+
options[:snapshot_name] = name
|
37
|
+
|
25
38
|
with_target_vms(argv) do |vm|
|
26
|
-
vm.action(:snapshot_restore,
|
39
|
+
vm.action(:snapshot_restore, options)
|
27
40
|
end
|
28
41
|
|
29
42
|
# Success, exit status 0
|
@@ -11,7 +11,7 @@ module VagrantPlugins
|
|
11
11
|
options = {}
|
12
12
|
|
13
13
|
opts = OptionParser.new do |o|
|
14
|
-
o.banner = "Usage: vagrant ssh [options] [name] [-- extra ssh args]"
|
14
|
+
o.banner = "Usage: vagrant ssh [options] [name|id] [-- extra ssh args]"
|
15
15
|
o.separator ""
|
16
16
|
o.separator "Options:"
|
17
17
|
o.separator ""
|
@@ -55,6 +55,7 @@ module VagrantPlugins
|
|
55
55
|
exit_status = env[:ssh_run_exit_status] || 0
|
56
56
|
return exit_status
|
57
57
|
else
|
58
|
+
Vagrant::Bundler.instance.deinit
|
58
59
|
@logger.debug("Invoking `ssh` action on machine")
|
59
60
|
vm.action(:ssh, ssh_opts: ssh_opts)
|
60
61
|
|
@@ -22,7 +22,7 @@ module VagrantPlugins
|
|
22
22
|
options[:provision_ignore_sentinel] = false
|
23
23
|
|
24
24
|
opts = OptionParser.new do |o|
|
25
|
-
o.banner = "Usage: vagrant up [options] [name]"
|
25
|
+
o.banner = "Usage: vagrant up [options] [name|id]"
|
26
26
|
o.separator ""
|
27
27
|
o.separator "Options:"
|
28
28
|
o.separator ""
|
@@ -128,9 +128,9 @@ module VagrantPlugins
|
|
128
128
|
# First create a set of all the providers we need to check for.
|
129
129
|
# Most likely this will be a set of one.
|
130
130
|
providers = Set.new
|
131
|
-
names
|
131
|
+
with_target_vms(names) do |machine|
|
132
132
|
# Check if we have this machine in the index
|
133
|
-
entry = @env.machine_index.get(name.to_s)
|
133
|
+
entry = @env.machine_index.get(machine.name.to_s)
|
134
134
|
|
135
135
|
# Get the provider for this machine. This logic isn't completely
|
136
136
|
# straightforward. If we have a forced provider, we always use
|
@@ -146,7 +146,7 @@ module VagrantPlugins
|
|
146
146
|
p = provider
|
147
147
|
p = entry.provider.to_sym if !p && entry
|
148
148
|
p = @env.default_provider(
|
149
|
-
machine: name.to_sym, check_usable: false) if !p
|
149
|
+
machine: machine.name.to_sym, check_usable: false) if !p
|
150
150
|
|
151
151
|
# Add it to the set
|
152
152
|
providers.add(p)
|
@@ -335,8 +335,8 @@ module VagrantPlugins
|
|
335
335
|
forward_agent: ssh_info[:forward_agent],
|
336
336
|
send_env: ssh_info[:forward_env],
|
337
337
|
keys: ssh_info[:private_key_path],
|
338
|
-
keys_only:
|
339
|
-
paranoid:
|
338
|
+
keys_only: ssh_info[:keys_only],
|
339
|
+
paranoid: ssh_info[:paranoid],
|
340
340
|
password: ssh_info[:password],
|
341
341
|
port: ssh_info[:port],
|
342
342
|
timeout: 15,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require "timeout"
|
2
|
-
|
3
1
|
require "log4r"
|
2
|
+
require "tempfile"
|
3
|
+
require "timeout"
|
4
4
|
|
5
5
|
require_relative "helper"
|
6
6
|
require_relative "shell"
|
@@ -10,6 +10,8 @@ module VagrantPlugins
|
|
10
10
|
module CommunicatorWinRM
|
11
11
|
# Provides communication channel for Vagrant commands via WinRM.
|
12
12
|
class Communicator < Vagrant.plugin("2", :communicator)
|
13
|
+
include Vagrant::Util
|
14
|
+
|
13
15
|
def self.match?(machine)
|
14
16
|
# This is useless, and will likely be removed in the future (this
|
15
17
|
# whole method).
|
@@ -142,6 +144,7 @@ module VagrantPlugins
|
|
142
144
|
|
143
145
|
opts[:good_exit] = Array(opts[:good_exit])
|
144
146
|
command = wrap_in_scheduled_task(command, opts[:interactive]) if opts[:elevated]
|
147
|
+
@logger.debug("#{opts[:shell]} executing:\n#{command}")
|
145
148
|
output = shell.send(opts[:shell], command, &block)
|
146
149
|
execution_output(output, opts)
|
147
150
|
end
|
@@ -201,15 +204,12 @@ module VagrantPlugins
|
|
201
204
|
interactive: interactive,
|
202
205
|
})
|
203
206
|
guest_script_path = "c:/tmp/vagrant-elevated-shell.ps1"
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
upload(
|
210
|
-
ensure
|
211
|
-
file.close
|
212
|
-
file.unlink
|
207
|
+
Tempfile.open(["vagrant-elevated-shell", "ps1"]) do |f|
|
208
|
+
f.binmode
|
209
|
+
f.write(script)
|
210
|
+
f.fsync
|
211
|
+
f.close
|
212
|
+
upload(f.path, guest_script_path)
|
213
213
|
end
|
214
214
|
|
215
215
|
# Convert to double byte unicode string then base64 encode
|
@@ -12,6 +12,7 @@ module VagrantPlugins
|
|
12
12
|
attr_accessor :transport
|
13
13
|
attr_accessor :ssl_peer_verification
|
14
14
|
attr_accessor :execution_time_limit
|
15
|
+
attr_accessor :basic_auth_only
|
15
16
|
|
16
17
|
def initialize
|
17
18
|
@username = UNSET_VALUE
|
@@ -25,12 +26,13 @@ module VagrantPlugins
|
|
25
26
|
@transport = UNSET_VALUE
|
26
27
|
@ssl_peer_verification = UNSET_VALUE
|
27
28
|
@execution_time_limit = UNSET_VALUE
|
29
|
+
@basic_auth_only = UNSET_VALUE
|
28
30
|
end
|
29
31
|
|
30
32
|
def finalize!
|
31
33
|
@username = "vagrant" if @username == UNSET_VALUE
|
32
34
|
@password = "vagrant" if @password == UNSET_VALUE
|
33
|
-
@transport = :
|
35
|
+
@transport = :negotiate if @transport == UNSET_VALUE
|
34
36
|
@host = nil if @host == UNSET_VALUE
|
35
37
|
is_ssl = @transport == :ssl
|
36
38
|
@port = (is_ssl ? 5986 : 5985) if @port == UNSET_VALUE
|
@@ -40,6 +42,7 @@ module VagrantPlugins
|
|
40
42
|
@timeout = 1800 if @timeout == UNSET_VALUE
|
41
43
|
@ssl_peer_verification = true if @ssl_peer_verification == UNSET_VALUE
|
42
44
|
@execution_time_limit = "PT2H" if @execution_time_limit == UNSET_VALUE
|
45
|
+
@basic_auth_only = false if @basic_auth_only == UNSET_VALUE
|
43
46
|
end
|
44
47
|
|
45
48
|
def validate(machine)
|
@@ -56,6 +59,9 @@ module VagrantPlugins
|
|
56
59
|
unless @ssl_peer_verification == true || @ssl_peer_verification == false
|
57
60
|
errors << "winrm.ssl_peer_verification must be a boolean."
|
58
61
|
end
|
62
|
+
unless @basic_auth_only == true || @basic_auth_only == false
|
63
|
+
errors << "winrm.basic_auth_only must be a boolean."
|
64
|
+
end
|
59
65
|
|
60
66
|
{ "WinRM" => errors }
|
61
67
|
end
|