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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1de343220b28131608158c1db4ff499abb2ff6
|
4
|
+
data.tar.gz: c696e8dd36edf81c1ba2b12ace45f2b60b96aa3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06d583f8d794ec15caa5dd5cbb3fb86b7bce98fb49f3a5bf08742b1bff885867ac7e1e3dbe1d213105171329fe7134bcdd2c2e8d6fca351fea3417b351596752
|
7
|
+
data.tar.gz: f84bd662999a52cd859af10044414f5f25e9e2a076a3c46fec7ab31aa3fa17cf9a2ee135d534f69872841bdfea820bc7847c2f24880de227f806177337f166f4
|
data/.gitignore
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
acceptance_config.yml
|
10
10
|
boxes/*
|
11
11
|
/.vagrant
|
12
|
-
/website
|
13
|
-
/website/
|
12
|
+
/website/.vagrant
|
13
|
+
/website/build
|
14
14
|
/vagrant-spec.config.rb
|
15
15
|
|
16
16
|
# Bundler/Rubygems
|
@@ -21,6 +21,7 @@ tags
|
|
21
21
|
/Gemfile.lock
|
22
22
|
test/tmp/
|
23
23
|
vendor/
|
24
|
+
/exec
|
24
25
|
|
25
26
|
# Documentation
|
26
27
|
_site/*
|
@@ -43,14 +44,3 @@ doc/
|
|
43
44
|
.ruby-gemset
|
44
45
|
.ruby-version
|
45
46
|
.rvmrc
|
46
|
-
|
47
|
-
# Website: docs
|
48
|
-
website/docs/.sass-cache
|
49
|
-
website/docs/build
|
50
|
-
website/docs/Rakefile
|
51
|
-
|
52
|
-
# Website: www
|
53
|
-
website/www/.sass-cache
|
54
|
-
website/www/build
|
55
|
-
website/www/Rakefile
|
56
|
-
exec/
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,165 @@
|
|
1
|
-
## 1.8.
|
1
|
+
## 1.8.4 (June 13, 2016)
|
2
|
+
|
3
|
+
BUG FIXES:
|
4
|
+
|
5
|
+
- core: Fix bundler plugin issue and version constraint [GH-7418, GH-7415]
|
6
|
+
- providers/virtualbox: Use 8 network interfaces (due to Windows limitation)
|
7
|
+
[GH-7417, GH-7419]
|
8
|
+
- provisioners/ansible(both): Honor "galaxy_roles_path" option when running
|
9
|
+
ansible-playbook [GH-7269, GH-7420]
|
10
|
+
- provisioners/ansible_local: Add quotes around "ansible-galaxy" arguments
|
11
|
+
[GH-7420]
|
12
|
+
|
13
|
+
IMPROVEMENTS:
|
14
|
+
|
15
|
+
- guests/redhat: Add CloudLinux detection [GH-7428, GH-7427]
|
16
|
+
|
17
|
+
## 1.8.3 (June 10, 2016)
|
18
|
+
|
19
|
+
BREAKING CHANGES:
|
20
|
+
|
21
|
+
- The `winrm` communicator now shares the same upload behavior as the `ssh`
|
22
|
+
communicator. This change should have no impact to most vagrant operations
|
23
|
+
but may break behavior when uploading directories to an existing
|
24
|
+
destination target. The `file` provisioner should be the only builtin
|
25
|
+
provisioner affected by this change. When uploading a directory and the
|
26
|
+
destination directory exists on the endpoint, the source base directory
|
27
|
+
will be created below the destination directory on the endpoint and the
|
28
|
+
source directory contents will be unzipped to that location. Prior to this
|
29
|
+
release, the contents of the source directory would be unzipped to an
|
30
|
+
existing destination directory without creating the source base directory.
|
31
|
+
This new behavior is more consistent with SCP and other well known shell copy commands.
|
32
|
+
- The Chef provisioner's `channel` default value has changed from "current" to
|
33
|
+
"stable". The "current" channel includes nightly releases and should be
|
34
|
+
opt-in only. Note that users wishing to download the Chef Development Kit
|
35
|
+
will need to opt into the "current" channel until Chef Software promotes
|
36
|
+
into the "stable" channel.
|
37
|
+
- The Arch Linux host capability for NFS removed support for rc.d in favor or
|
38
|
+
systemd which has been present since 2012. Please see GH-7181 for more
|
39
|
+
information.
|
40
|
+
|
41
|
+
FEATURES:
|
42
|
+
|
43
|
+
- provider/docker: Allow non-linux users to opt-out of the host VM to run
|
44
|
+
Docker containers by setting `config.force_host_vm = false` in the
|
45
|
+
Vagrantfile. This is especially useful for customers who wish to use
|
46
|
+
the beta builds for Mac and Windows, dlite, or a custom provider.
|
47
|
+
[GH-7277, GH-7298, 8c11b53]
|
48
|
+
- provider/docker: New command: `docker-exec` allows attaching to an
|
49
|
+
already-running container.
|
50
|
+
[GH-7377, GH-6566, GH-5193, GH-4904, GH-4057, GH-4179, GH-4903]
|
51
|
+
|
52
|
+
IMPROVEMENTS:
|
53
|
+
|
54
|
+
- core/downloader: increase box resume download limit to 24h
|
55
|
+
[GH-7352, GH-7272]
|
56
|
+
- core/package: run validations prior to packaging [GH-7353, GH-7351]
|
57
|
+
- core/action: make `start` ("vagrant up") run provisioners [GH-4467, GH-4421]
|
58
|
+
- commands/all: Make it clear that machine IDs can be specified
|
59
|
+
[GH-7356, GH-7228]
|
60
|
+
- commands/init: Add support for specifying the box version [GH-7363, GH-5004]
|
61
|
+
- commands/login: Print a warning with both the environment variable and
|
62
|
+
local login token are present [GH-7206, GH-7219]
|
63
|
+
- communicators/winrm: Upgrade to latest WinRM gems [GH-6922]
|
64
|
+
- provisioners/ansible_local: Allow to install Ansible from pip,
|
65
|
+
with version selection capability [GH-6654, GH-7167]
|
66
|
+
- provisioners/ansible_local: Use `provisioning_path` as working directory
|
67
|
+
for `ansible-galaxy` execution
|
68
|
+
- provisioners/ansible(both provisioners): Add basic config
|
69
|
+
validators/converters on `raw_arguments` and `raw_ssh_args` options
|
70
|
+
[GH-7103]
|
71
|
+
- provisioners/chef: Add the ability to install on SUSE [GH-6806]
|
72
|
+
- provisioners/chef: Support legacy solo mode [GH-7327]
|
73
|
+
- provisioners/docker: Restart container if newer image is available
|
74
|
+
[GH-7358, GH-6620]
|
75
|
+
- hosts/arch: Remove sysvinit and assume systemd [GH-7181]
|
76
|
+
- hosts/linux: Do not use a pager with systemctl commands [GH-7270]
|
77
|
+
- hosts/darwin: Add `extra_args` support for RDP [GH-5523, GH-6602]
|
78
|
+
- hosts/windows: Use SafeExec to capture history in Powershell [GH-6749]
|
79
|
+
- guests/amazon: Add detection [GH-7395, GH-7254]
|
80
|
+
- guests/freebsd: Add quotes around hostname [GH-6867]
|
81
|
+
- guests/fedora: Add support for ipv6 static networks [GH-7275, GH-7276]
|
82
|
+
- guests/tinycore: Add support for shared folders [GH-6977, GH-6968]
|
83
|
+
- guests/trisquel: Add initial support [GH-6842, GH-6843]
|
84
|
+
- guests/windows: Add support for automatic login (no password prompting)
|
85
|
+
[GH-5670]
|
86
|
+
- core: Add `--no-delete` and provisioning flags to snapshot restore/pop
|
87
|
+
[GH-6879]
|
88
|
+
- providers/docker: Allow TCP and UDP ports on the same number [GH-7365,
|
89
|
+
GH-5527]
|
90
|
+
- providers/hyperv: Add support for differencing disk [GH-7090]
|
91
|
+
- providers/hyperv: Add support for snapshots [GH-7110]
|
92
|
+
- providers/hyperv: Reinstate compatibility with PS 4 [GH-7108]
|
93
|
+
- providers/virtualbox: Add linked clone support for Virtualbox 1.4 [GH-7050]
|
94
|
+
- synced_folders/nfs: Read static and dynamic IPs [GH-7290, GH-7289]
|
95
|
+
|
96
|
+
BUG FIXES:
|
97
|
+
|
98
|
+
- core: Bump nokogiri version to fix windows bug [GH-6766, GH-6848]
|
99
|
+
- core: Revert a change made to the output of the identify file [GH-6962,
|
100
|
+
GH-6929, GH-6589]
|
101
|
+
- core: Fix login command behind a proxy [GH-6898, GH-6899]
|
102
|
+
- core: Fix support for regular expressions on multi-machine `up`
|
103
|
+
[GH-6908, GH-6909]
|
104
|
+
- core: Allow boxes to use pre-release versions [GH-6892, GH-6893]
|
105
|
+
- core: Rescue `Errno:ENOTCONN` waiting for port to be open [GH-7182, GH-7184]
|
106
|
+
- core: Properly authenticate metadata box URLs [GH-6776, GH-7158]
|
107
|
+
- core: Do not run provisioners if already run on resume [GH-7059, GH-6787]
|
108
|
+
- core: Implement better tracking of tempfiles and tmpdirs to identify file
|
109
|
+
leaks [GH-7355]
|
110
|
+
- core: Allow SSH forwarding on Windows [GH-7287, GH-7202]
|
111
|
+
- core: Allow customizing `keys_only` SSH option [GH-7360, GH-4275]
|
112
|
+
- core: Allow customizing `paranoid` SSH option [GH-7360, GH-4275]
|
113
|
+
- command/box_update: Do not update the same box twice [GH-6042, GH-7379]
|
114
|
+
- command/init: Remove unnecessary `sudo` from generated Vagrantfile
|
115
|
+
[GH-7369, GH-7295]
|
116
|
+
- docs & core: Be consistent about the "2" in the Vagrantfile version
|
117
|
+
[GH-6961, GH-6963]
|
118
|
+
- guests/all: Refactor guest capabilities to run in a single command -
|
119
|
+
**please see GH-7393 for the complete list of changes!**
|
120
|
+
- guests/arch: Restart network after configuration [GH-7120, GH-7119]
|
121
|
+
- guests/debian: Do not return an error if ifdown fails [GH-7159,
|
122
|
+
GH-7155, GH-6871]
|
123
|
+
- guests/freebsd: Use `pkg` to install rsync [GH-6760]
|
124
|
+
- guests/freebsd: Use `netif` to configure networks [GH-5852, GH-7093]
|
125
|
+
- guests/coreos: Detect all interface names [GH-6608, GH-6610]
|
126
|
+
- providers/hyperv: Only specify Hyper-V if the parameter is support
|
127
|
+
[GH-7101, GH-7098]
|
128
|
+
- providers/virtualbox: Set maximum network adapters to 36 [GH-7293, GH-7286]
|
129
|
+
- providers/virtualbox: Do not fail when master VM from linked clone is
|
130
|
+
missing [GH-7126, GH-6742]
|
131
|
+
- providers/virtualbox: Use scoped overrides in preparring NFS
|
132
|
+
[GH-7387, GH-7386]
|
133
|
+
- provisioners/ansible: Fix a race condition in the concurrent generations of
|
134
|
+
the ansible inventory file, while running `vagrant up --parallel`
|
135
|
+
[GH-6526, GH-7190]
|
136
|
+
- provisioners/ansible_local: Don't quote the Ansible arguments defined in the
|
137
|
+
`raw_arguments` option [GH-7103]
|
138
|
+
- provisioners/ansible_local: Format json `extra_vars` with double quotes
|
139
|
+
[GH-6726, GH-7103]
|
140
|
+
- provisioners/ansible_local: Fix errors in absolute paths to playbook or
|
141
|
+
galaxy resources when running on a Windows host [GH-6740, GH-6757]
|
142
|
+
- provisioners/ansible_local: Change the way to verify `ansible-galaxy`
|
143
|
+
presence, to avoid a non-zero status code with Ansible 2.0 [GH-6793]
|
144
|
+
- provisioners/ansible(both provisioners): The Ansible configuration files
|
145
|
+
detection is only executed by the `provision` action [GH-6763, GH-6984]
|
146
|
+
- provisioners/chef: Do not use double sudo when installing
|
147
|
+
[GGH-6805, GH-6804]
|
148
|
+
- provisioners/chef: Change the default channel to "stable" (previously it
|
149
|
+
was "current") [GH-7001, GH-6979]
|
150
|
+
- provisioners/chef: Default node_name to hostname if present
|
151
|
+
[GH-7063, GH-7153]
|
152
|
+
- provisioners/docker: Fix -no-trunc command option [GH-7085]
|
153
|
+
- provisioners/docker: Allow provisioning when container name is specified
|
154
|
+
[GH-7074, GH-7086]
|
155
|
+
- provisioners/puppet: Use `where.exe` to locate puppet binary
|
156
|
+
[GH-6912, GH-6876]
|
157
|
+
- provisioners/salt: Move masterless config to apply to all platforms
|
158
|
+
[GH-7207, Gh-6924, GH-6915]
|
159
|
+
- pushes/ftp: Create parent directories when uploading [GH-7154, GH-6316]
|
160
|
+
- synced_folders/smb: Do not interpolate configuration file [GH-6906]
|
161
|
+
|
162
|
+
## 1.8.1 (December 21, 2015)
|
2
163
|
|
3
164
|
BUG FIXES:
|
4
165
|
|
@@ -8,6 +169,8 @@ BUG FIXES:
|
|
8
169
|
UNC paths [GH-6598]
|
9
170
|
- core: Fix a crash in parsing the config in some cases with network
|
10
171
|
configurations [GH-6730]
|
172
|
+
- core: Clean up temporarily files created by bundler
|
173
|
+
[GH-7354, GH-6301, GH-3469, GH-6231]
|
11
174
|
- commands/up: Smarter logic about what provider to install, avoiding
|
12
175
|
situations where VirtualBox was installed over the correct provider [GH-6731]
|
13
176
|
- guests/debian: Fix Docker install [GH-6722]
|
@@ -590,7 +753,7 @@ BUG FIXES:
|
|
590
753
|
- commands/package: base package won't crash with exception [GH-4017]
|
591
754
|
- commands/rsync-auto: Destroyed machines won't raise exceptions. [GH-4031]
|
592
755
|
- commands/ssh: Extra args are passed through to Docker container. [GH-4378]
|
593
|
-
- communicators/ssh: Nicer error if remote unexpectedly
|
756
|
+
- communicators/ssh: Nicer error if remote unexpectedly disconnects. [GH-4038]
|
594
757
|
- communicators/ssh: Clean error when max sessions is hit. [GH-4044]
|
595
758
|
- communicators/ssh: Fix many issues around PTY-enabled output parsing.
|
596
759
|
[GH-4408]
|
@@ -1299,7 +1462,7 @@ IMPROVEMENTS:
|
|
1299
1462
|
certs from a custom CA. [GH-2337]
|
1300
1463
|
- commands/box/add: Can now specify a client cert when downloading a
|
1301
1464
|
box. [GH-1889]
|
1302
|
-
- commands/init: Add `--output` option for
|
1465
|
+
- commands/init: Add `--output` option for specifying output path, or
|
1303
1466
|
"-" for stdin. [GH-1364]
|
1304
1467
|
- commands/provision: Add `--no-parallel` option to disable provider
|
1305
1468
|
parallelization if the provider supports it. [GH-2404]
|
@@ -2838,7 +3001,7 @@ compatibility.
|
|
2838
3001
|
in a saved state. [GH-123]
|
2839
3002
|
- Added `config.chef.recipe_url` which allows you to specify a URL to
|
2840
3003
|
a gzipped tar file for chef solo to download cookbooks. See the
|
2841
|
-
[chef-solo docs](
|
3004
|
+
[chef-solo docs](https://docs.chef.io/chef_solo.html) for more information.
|
2842
3005
|
[GH-121]
|
2843
3006
|
- Added `vagrant box repackage` which repackages boxes which have
|
2844
3007
|
been added. This is useful in case you want to redistribute a base
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2010-
|
3
|
+
Copyright (c) 2010-2016 Mitchell Hashimoto
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Website: [https://www.vagrantup.com/](https://www.vagrantup.com/)
|
4
4
|
* Source: [https://github.com/mitchellh/vagrant](https://github.com/mitchellh/vagrant)
|
5
5
|
* IRC: `#vagrant` on Freenode
|
6
|
-
* Mailing list: [Google Groups](
|
6
|
+
* Mailing list: [Google Groups](https://groups.google.com/group/vagrant-up)
|
7
7
|
|
8
8
|
Vagrant is a tool for building and distributing development environments.
|
9
9
|
|
@@ -21,12 +21,12 @@ between Windows, Mac OS X, and Linux.
|
|
21
21
|
For the quick-start, we'll bring up a development machine on
|
22
22
|
[VirtualBox](https://www.virtualbox.org/) because it is free and works
|
23
23
|
on all major platforms. Vagrant can, however, work with almost any
|
24
|
-
system such as [OpenStack] (https://www.openstack.org/), [VMware] (
|
24
|
+
system such as [OpenStack] (https://www.openstack.org/), [VMware] (https://www.vmware.com/), [Docker] (https://docs.docker.com/), etc.
|
25
25
|
|
26
26
|
First, make sure your development machine has
|
27
27
|
[VirtualBox](https://www.virtualbox.org/)
|
28
28
|
installed. After this,
|
29
|
-
[download and install the appropriate Vagrant package for your OS](
|
29
|
+
[download and install the appropriate Vagrant package for your OS](https://www.vagrantup.com/downloads.html).
|
30
30
|
|
31
31
|
To build your first virtual environment:
|
32
32
|
|
@@ -40,7 +40,7 @@ the box doesn't already exist on your system.
|
|
40
40
|
## Getting Started Guide
|
41
41
|
|
42
42
|
To learn how to build a fully functional development environment, follow the
|
43
|
-
[getting started guide](
|
43
|
+
[getting started guide](https://www.vagrantup.com/docs/getting-started/index.html).
|
44
44
|
|
45
45
|
## Installing the Gem from Git
|
46
46
|
|
@@ -53,13 +53,11 @@ Ruby 2.0 is needed.
|
|
53
53
|
|
54
54
|
## Contributing to Vagrant
|
55
55
|
|
56
|
-
|
56
|
+
To install Vagrant from source, please [follow the guide in the Wiki](https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-Source).
|
57
57
|
|
58
|
-
|
59
|
-
be installed with a simple `gem install bundler`. Afterwards, do the following:
|
58
|
+
You can run the test suite with:
|
60
59
|
|
61
|
-
bundle
|
62
|
-
rake
|
60
|
+
bundle exec rake
|
63
61
|
|
64
62
|
This will run the unit test suite, which should come back all green! Then you're good to go!
|
65
63
|
|
data/RELEASE.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Releasing Vagrant
|
2
|
+
|
3
|
+
This documents how to release Vagrant. Various steps in this document will
|
4
|
+
require privileged access to private systems, so this document is only
|
5
|
+
targetted at Vagrant core members who have the ability to cut a release.
|
6
|
+
|
7
|
+
1. Update `version.txt` to the version you want to release.
|
8
|
+
|
9
|
+
1. Update `CHANGELOG.md` to have a header with the release version and date.
|
10
|
+
|
11
|
+
1. Commit those changes and also tag the release with the version:
|
12
|
+
`git tag vX.Y.Z`. Push them.
|
13
|
+
|
14
|
+
1. Trigger an installer creation run within the HashiCorp Bamboo
|
15
|
+
installation. This will take around 45 minutes.
|
16
|
+
|
17
|
+
1. Download all the resulting artifacts into the `pkg/dist` folder
|
18
|
+
relative to the Vagrant repository.
|
19
|
+
|
20
|
+
1. Run the awkwardly-named `./scripts/bintray_upload.sh` with the version
|
21
|
+
that is being created. This must be run from the Vagrant repo root.
|
22
|
+
This will GPG sign and checksum the files.
|
23
|
+
|
24
|
+
1. Run `hc-releases -upload pkg/dist` to upload the releases to S3.
|
25
|
+
|
26
|
+
1. Update `website/config.rb` to point to the latest version. Commit and push.
|
27
|
+
|
28
|
+
1. Use Atlas `hashicorp/vagrant-www` to deploy the site by queueing a build.
|
data/bin/vagrant
CHANGED
data/contrib/bash/completion.sh
CHANGED
@@ -53,7 +53,7 @@ __vagrantinvestigate() {
|
|
53
53
|
_vagrant() {
|
54
54
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
55
55
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
56
|
-
commands="box connect destroy docker-logs docker-run global-status halt help init list-commands login package plugin provision push rdp reload resume rsync rsync-auto share ssh ssh-config status suspend up version"
|
56
|
+
commands="box connect destroy docker-exec docker-logs docker-run global-status halt help init list-commands login package plugin provision push rdp reload resume rsync rsync-auto share snapshot ssh ssh-config status suspend up version"
|
57
57
|
|
58
58
|
if [ $COMP_CWORD == 1 ]
|
59
59
|
then
|
@@ -104,6 +104,11 @@ _vagrant() {
|
|
104
104
|
COMPREPLY=($(compgen -W "${commands}" -- ${cur}))
|
105
105
|
return 0
|
106
106
|
;;
|
107
|
+
"snapshot")
|
108
|
+
snapshot_commands="delete list pop push restore save"
|
109
|
+
COMPREPLY=($(compgen -W "${snapshot_commands}" -- ${cur}))
|
110
|
+
return 0
|
111
|
+
;;
|
107
112
|
*)
|
108
113
|
;;
|
109
114
|
esac
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
|
2
|
-
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server.service
|
2
|
+
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status --no-pager nfs-server.service
|
3
3
|
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
|
4
4
|
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
|
5
5
|
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /*/exports
|
data/keys/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Insecure Keypair
|
2
2
|
|
3
3
|
These keys are the "insecure" public/private keypair we offer to
|
4
|
-
[base box creators](
|
4
|
+
[base box creators](https://www.vagrantup.com/docs/boxes/base.html) for use in their base boxes so that
|
5
5
|
vagrant installations can automatically SSH into the boxes.
|
6
6
|
|
7
7
|
If you're working with a team or company or with a custom box and
|
@@ -18,6 +18,10 @@ module Vagrant
|
|
18
18
|
# to NOT be metadata.
|
19
19
|
METADATA_SIZE_LIMIT = 20971520
|
20
20
|
|
21
|
+
# This is the amount of time to "resume" downloads if a partial box
|
22
|
+
# file already exists.
|
23
|
+
RESUME_DELAY = 24 * 60 * 60
|
24
|
+
|
21
25
|
def initialize(app, env)
|
22
26
|
@app = app
|
23
27
|
@logger = Log4r::Logger.new("vagrant::action::builtin::box_add")
|
@@ -253,7 +257,7 @@ module Vagrant
|
|
253
257
|
end
|
254
258
|
|
255
259
|
provider_url = metadata_provider.url
|
256
|
-
if
|
260
|
+
if provider_url != authenticated_url
|
257
261
|
# Authenticate the provider URL since we're using auth
|
258
262
|
hook_env = env[:hook].call(:authenticate_box_url, box_urls: [provider_url])
|
259
263
|
authed_urls = hook_env[:box_urls]
|
@@ -261,7 +265,7 @@ module Vagrant
|
|
261
265
|
raise "Bad box authentication hook, did not generate proper results."
|
262
266
|
end
|
263
267
|
provider_url = authed_urls[0]
|
264
|
-
|
268
|
+
end
|
265
269
|
|
266
270
|
box_add(
|
267
271
|
[[provider_url, metadata_provider.url]],
|
@@ -393,7 +397,7 @@ module Vagrant
|
|
393
397
|
if env[:box_clean]
|
394
398
|
@logger.info("Cleaning existing temp box file.")
|
395
399
|
delete = true
|
396
|
-
elsif temp_path.mtime.to_i < (Time.now.to_i -
|
400
|
+
elsif temp_path.mtime.to_i < (Time.now.to_i - RESUME_DELAY)
|
397
401
|
@logger.info("Existing temp file is too old. Removing.")
|
398
402
|
delete = true
|
399
403
|
end
|
@@ -3,6 +3,7 @@ require "pathname"
|
|
3
3
|
|
4
4
|
require 'vagrant/util/safe_chdir'
|
5
5
|
require 'vagrant/util/subprocess'
|
6
|
+
require 'vagrant/util/presence'
|
6
7
|
|
7
8
|
module Vagrant
|
8
9
|
module Action
|
@@ -20,25 +21,63 @@ module Vagrant
|
|
20
21
|
class Package
|
21
22
|
include Util
|
22
23
|
|
24
|
+
# Perform sanity validations that the provided output filepath is sane.
|
25
|
+
# In particular, this function validates:
|
26
|
+
#
|
27
|
+
# - The output path is a regular file (not a directory or symlink)
|
28
|
+
# - No file currently exists at the given path
|
29
|
+
# - A directory of package files was actually provided (internal)
|
30
|
+
#
|
31
|
+
# @param [String] output path to the output file
|
32
|
+
# @param [String] directory path to a directory containing the files
|
33
|
+
def self.validate!(output, directory)
|
34
|
+
filename = File.basename(output.to_s)
|
35
|
+
output = fullpath(output)
|
36
|
+
|
37
|
+
if File.directory?(output)
|
38
|
+
raise Vagrant::Errors::PackageOutputDirectory
|
39
|
+
end
|
40
|
+
|
41
|
+
if File.exist?(output)
|
42
|
+
raise Vagrant::Errors::PackageOutputExists, filename: filename
|
43
|
+
end
|
44
|
+
|
45
|
+
if !Vagrant::Util::Presence.present?(directory) || !File.directory?(directory)
|
46
|
+
raise Vagrant::Errors::PackageRequiresDirectory
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Calculate the full path of the given path, relative to the current
|
51
|
+
# working directory (where the command was run).
|
52
|
+
#
|
53
|
+
# @param [String] output the relative path
|
54
|
+
def self.fullpath(output)
|
55
|
+
File.expand_path(output, Dir.pwd)
|
56
|
+
end
|
57
|
+
|
58
|
+
# The path to the final output file.
|
59
|
+
# @return [String]
|
60
|
+
attr_reader :fullpath
|
61
|
+
|
23
62
|
def initialize(app, env)
|
24
63
|
@app = app
|
25
64
|
|
26
65
|
env["package.files"] ||= {}
|
27
66
|
env["package.output"] ||= "package.box"
|
67
|
+
|
68
|
+
@fullpath = self.class.fullpath(env["package.output"])
|
28
69
|
end
|
29
70
|
|
30
71
|
def call(env)
|
31
72
|
@env = env
|
32
|
-
file_name = File.basename(@env["package.output"].to_s)
|
33
73
|
|
34
|
-
|
35
|
-
|
36
|
-
raise Errors::
|
37
|
-
!File.directory?(env["package.directory"])
|
74
|
+
self.class.validate!(env["package.output"], env["package.directory"])
|
75
|
+
|
76
|
+
raise Errors::PackageOutputDirectory if File.directory?(fullpath)
|
38
77
|
|
39
78
|
@app.call(env)
|
40
79
|
|
41
|
-
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing",
|
80
|
+
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing", fullpath: fullpath)
|
42
81
|
copy_include_files
|
43
82
|
setup_private_key
|
44
83
|
compress
|
@@ -54,7 +93,7 @@ module Vagrant
|
|
54
93
|
end
|
55
94
|
|
56
95
|
# Cleanup any packaged files if the packaging failed at some point.
|
57
|
-
File.delete(
|
96
|
+
File.delete(fullpath) if File.exist?(fullpath)
|
58
97
|
end
|
59
98
|
|
60
99
|
# This method copies the include files (passed in via command line)
|
@@ -88,7 +127,7 @@ module Vagrant
|
|
88
127
|
def compress
|
89
128
|
# Get the output path. We have to do this up here so that the
|
90
129
|
# pwd returns the proper thing.
|
91
|
-
output_path =
|
130
|
+
output_path = fullpath.to_s
|
92
131
|
|
93
132
|
# Switch into that directory and package everything up
|
94
133
|
Util::SafeChdir.safe_chdir(@env["package.directory"]) do
|
@@ -147,11 +186,6 @@ module Vagrant
|
|
147
186
|
f.puts %Q[end]
|
148
187
|
end
|
149
188
|
end
|
150
|
-
|
151
|
-
# Path to the final box output file
|
152
|
-
def tar_path
|
153
|
-
File.expand_path(@env["package.output"], FileUtils.pwd)
|
154
|
-
end
|
155
189
|
end
|
156
190
|
end
|
157
191
|
end
|