vagrant-lxc 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +14 -6
- data/Gemfile +19 -14
- data/Gemfile.lock +10 -5
- data/README.md +18 -42
- data/development/Vagrantfile.1.0 +3 -2
- data/lib/vagrant-lxc/version.rb +1 -1
- data/lib/vagrant-lxc.rb +0 -2
- data/vagrant-lxc.gemspec +1 -14
- metadata +7 -540
- data/.gitmodules +0 -3
- data/bin/vagrant-lxc +0 -9
- data/lib/vendored_vagrant.rb +0 -9
- data/vendor/.gitkeep +0 -0
- data/vendor/vagrant/.gitignore +0 -31
- data/vendor/vagrant/.travis.yml +0 -7
- data/vendor/vagrant/.yardopts +0 -1
- data/vendor/vagrant/CHANGELOG.md +0 -803
- data/vendor/vagrant/Gemfile +0 -3
- data/vendor/vagrant/LICENSE +0 -21
- data/vendor/vagrant/README.md +0 -89
- data/vendor/vagrant/Rakefile +0 -18
- data/vendor/vagrant/bin/vagrant +0 -84
- data/vendor/vagrant/config/default.rb +0 -35
- data/vendor/vagrant/contrib/README.md +0 -12
- data/vendor/vagrant/contrib/bash/completion.sh +0 -3
- data/vendor/vagrant/contrib/emacs/vagrant.el +0 -8
- data/vendor/vagrant/contrib/vim/vagrantfile.vim +0 -9
- data/vendor/vagrant/keys/README.md +0 -17
- data/vendor/vagrant/keys/vagrant +0 -27
- data/vendor/vagrant/keys/vagrant.pub +0 -1
- data/vendor/vagrant/lib/vagrant/action/builder.rb +0 -154
- data/vendor/vagrant/lib/vagrant/action/builtin/box_add.rb +0 -79
- data/vendor/vagrant/lib/vagrant/action/builtin/call.rb +0 -67
- data/vendor/vagrant/lib/vagrant/action/builtin/config_validate.rb +0 -30
- data/vendor/vagrant/lib/vagrant/action/builtin/confirm.rb +0 -38
- data/vendor/vagrant/lib/vagrant/action/builtin/env_set.rb +0 -24
- data/vendor/vagrant/lib/vagrant/action/builtin/graceful_halt.rb +0 -73
- data/vendor/vagrant/lib/vagrant/action/builtin/handle_box_url.rb +0 -43
- data/vendor/vagrant/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +0 -117
- data/vendor/vagrant/lib/vagrant/action/builtin/lock.rb +0 -57
- data/vendor/vagrant/lib/vagrant/action/builtin/nfs.rb +0 -117
- data/vendor/vagrant/lib/vagrant/action/builtin/provision.rb +0 -70
- data/vendor/vagrant/lib/vagrant/action/builtin/set_hostname.rb +0 -27
- data/vendor/vagrant/lib/vagrant/action/builtin/ssh_exec.rb +0 -42
- data/vendor/vagrant/lib/vagrant/action/builtin/ssh_run.rb +0 -43
- data/vendor/vagrant/lib/vagrant/action/general/package.rb +0 -102
- data/vendor/vagrant/lib/vagrant/action/hook.rb +0 -103
- data/vendor/vagrant/lib/vagrant/action/runner.rb +0 -69
- data/vendor/vagrant/lib/vagrant/action/warden.rb +0 -103
- data/vendor/vagrant/lib/vagrant/action.rb +0 -42
- data/vendor/vagrant/lib/vagrant/box.rb +0 -93
- data/vendor/vagrant/lib/vagrant/box_collection.rb +0 -315
- data/vendor/vagrant/lib/vagrant/cli.rb +0 -82
- data/vendor/vagrant/lib/vagrant/config/container.rb +0 -37
- data/vendor/vagrant/lib/vagrant/config/loader.rb +0 -222
- data/vendor/vagrant/lib/vagrant/config/v1/dummy_config.rb +0 -13
- data/vendor/vagrant/lib/vagrant/config/v1/loader.rb +0 -105
- data/vendor/vagrant/lib/vagrant/config/v1/root.rb +0 -60
- data/vendor/vagrant/lib/vagrant/config/v1.rb +0 -9
- data/vendor/vagrant/lib/vagrant/config/v2/dummy_config.rb +0 -13
- data/vendor/vagrant/lib/vagrant/config/v2/loader.rb +0 -141
- data/vendor/vagrant/lib/vagrant/config/v2/root.rb +0 -105
- data/vendor/vagrant/lib/vagrant/config/v2/util.rb +0 -21
- data/vendor/vagrant/lib/vagrant/config/v2.rb +0 -9
- data/vendor/vagrant/lib/vagrant/config/version_base.rb +0 -80
- data/vendor/vagrant/lib/vagrant/config.rb +0 -63
- data/vendor/vagrant/lib/vagrant/downloaders/base.rb +0 -22
- data/vendor/vagrant/lib/vagrant/downloaders/file.rb +0 -28
- data/vendor/vagrant/lib/vagrant/downloaders/http.rb +0 -116
- data/vendor/vagrant/lib/vagrant/downloaders.rb +0 -7
- data/vendor/vagrant/lib/vagrant/environment.rb +0 -729
- data/vendor/vagrant/lib/vagrant/errors.rb +0 -486
- data/vendor/vagrant/lib/vagrant/hosts.rb +0 -28
- data/vendor/vagrant/lib/vagrant/machine.rb +0 -325
- data/vendor/vagrant/lib/vagrant/machine_state.rb +0 -45
- data/vendor/vagrant/lib/vagrant/plugin/v1/command.rb +0 -169
- data/vendor/vagrant/lib/vagrant/plugin/v1/communicator.rb +0 -98
- data/vendor/vagrant/lib/vagrant/plugin/v1/config.rb +0 -112
- data/vendor/vagrant/lib/vagrant/plugin/v1/errors.rb +0 -15
- data/vendor/vagrant/lib/vagrant/plugin/v1/guest.rb +0 -92
- data/vendor/vagrant/lib/vagrant/plugin/v1/host.rb +0 -66
- data/vendor/vagrant/lib/vagrant/plugin/v1/manager.rb +0 -131
- data/vendor/vagrant/lib/vagrant/plugin/v1/plugin.rb +0 -229
- data/vendor/vagrant/lib/vagrant/plugin/v1/provider.rb +0 -68
- data/vendor/vagrant/lib/vagrant/plugin/v1/provisioner.rb +0 -50
- data/vendor/vagrant/lib/vagrant/plugin/v1.rb +0 -19
- data/vendor/vagrant/lib/vagrant/plugin/v2/command.rb +0 -234
- data/vendor/vagrant/lib/vagrant/plugin/v2/communicator.rb +0 -98
- data/vendor/vagrant/lib/vagrant/plugin/v2/components.rb +0 -29
- data/vendor/vagrant/lib/vagrant/plugin/v2/config.rb +0 -101
- data/vendor/vagrant/lib/vagrant/plugin/v2/errors.rb +0 -15
- data/vendor/vagrant/lib/vagrant/plugin/v2/guest.rb +0 -92
- data/vendor/vagrant/lib/vagrant/plugin/v2/host.rb +0 -66
- data/vendor/vagrant/lib/vagrant/plugin/v2/manager.rb +0 -158
- data/vendor/vagrant/lib/vagrant/plugin/v2/plugin.rb +0 -217
- data/vendor/vagrant/lib/vagrant/plugin/v2/provider.rb +0 -69
- data/vendor/vagrant/lib/vagrant/plugin/v2/provisioner.rb +0 -47
- data/vendor/vagrant/lib/vagrant/plugin/v2.rb +0 -22
- data/vendor/vagrant/lib/vagrant/plugin.rb +0 -6
- data/vendor/vagrant/lib/vagrant/registry.rb +0 -78
- data/vendor/vagrant/lib/vagrant/ssh.rb +0 -132
- data/vendor/vagrant/lib/vagrant/test_helpers.rb +0 -154
- data/vendor/vagrant/lib/vagrant/ui.rb +0 -170
- data/vendor/vagrant/lib/vagrant/util/ansi_escape_code_remover.rb +0 -34
- data/vendor/vagrant/lib/vagrant/util/busy.rb +0 -59
- data/vendor/vagrant/lib/vagrant/util/counter.rb +0 -24
- data/vendor/vagrant/lib/vagrant/util/file_checksum.rb +0 -38
- data/vendor/vagrant/lib/vagrant/util/file_mode.rb +0 -12
- data/vendor/vagrant/lib/vagrant/util/hash_with_indifferent_access.rb +0 -63
- data/vendor/vagrant/lib/vagrant/util/is_port_open.rb +0 -38
- data/vendor/vagrant/lib/vagrant/util/line_ending_helpers.rb +0 -14
- data/vendor/vagrant/lib/vagrant/util/network_ip.rb +0 -28
- data/vendor/vagrant/lib/vagrant/util/platform.rb +0 -68
- data/vendor/vagrant/lib/vagrant/util/retryable.rb +0 -31
- data/vendor/vagrant/lib/vagrant/util/safe_exec.rb +0 -36
- data/vendor/vagrant/lib/vagrant/util/safe_puts.rb +0 -31
- data/vendor/vagrant/lib/vagrant/util/scoped_hash_override.rb +0 -45
- data/vendor/vagrant/lib/vagrant/util/ssh.rb +0 -126
- data/vendor/vagrant/lib/vagrant/util/stacked_proc_runner.rb +0 -35
- data/vendor/vagrant/lib/vagrant/util/string_block_editor.rb +0 -75
- data/vendor/vagrant/lib/vagrant/util/subprocess.rb +0 -270
- data/vendor/vagrant/lib/vagrant/util/template_renderer.rb +0 -83
- data/vendor/vagrant/lib/vagrant/util/which.rb +0 -43
- data/vendor/vagrant/lib/vagrant/util.rb +0 -12
- data/vendor/vagrant/lib/vagrant/version.rb +0 -6
- data/vendor/vagrant/lib/vagrant.rb +0 -251
- data/vendor/vagrant/plugins/README.md +0 -5
- data/vendor/vagrant/plugins/commands/box/command/add.rb +0 -52
- data/vendor/vagrant/plugins/commands/box/command/list.rb +0 -41
- data/vendor/vagrant/plugins/commands/box/command/remove.rb +0 -37
- data/vendor/vagrant/plugins/commands/box/command/repackage.rb +0 -43
- data/vendor/vagrant/plugins/commands/box/command/root.rb +0 -75
- data/vendor/vagrant/plugins/commands/box/plugin.rb +0 -15
- data/vendor/vagrant/plugins/commands/destroy/command.rb +0 -31
- data/vendor/vagrant/plugins/commands/destroy/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/halt/command.rb +0 -33
- data/vendor/vagrant/plugins/commands/halt/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/init/command.rb +0 -40
- data/vendor/vagrant/plugins/commands/init/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/package/command.rb +0 -78
- data/vendor/vagrant/plugins/commands/package/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/plugin/action/bundler_check.rb +0 -25
- data/vendor/vagrant/plugins/commands/plugin/action/install_gem.rb +0 -70
- data/vendor/vagrant/plugins/commands/plugin/action/license_plugin.rb +0 -54
- data/vendor/vagrant/plugins/commands/plugin/action/list_plugins.rb +0 -54
- data/vendor/vagrant/plugins/commands/plugin/action/prune_gems.rb +0 -149
- data/vendor/vagrant/plugins/commands/plugin/action/uninstall_plugin.rb +0 -23
- data/vendor/vagrant/plugins/commands/plugin/action.rb +0 -52
- data/vendor/vagrant/plugins/commands/plugin/command/base.rb +0 -22
- data/vendor/vagrant/plugins/commands/plugin/command/install.rb +0 -39
- data/vendor/vagrant/plugins/commands/plugin/command/license.rb +0 -31
- data/vendor/vagrant/plugins/commands/plugin/command/list.rb +0 -28
- data/vendor/vagrant/plugins/commands/plugin/command/root.rb +0 -75
- data/vendor/vagrant/plugins/commands/plugin/command/uninstall.rb +0 -28
- data/vendor/vagrant/plugins/commands/plugin/gem_helper.rb +0 -74
- data/vendor/vagrant/plugins/commands/plugin/plugin.rb +0 -22
- data/vendor/vagrant/plugins/commands/plugin/state_file.rb +0 -57
- data/vendor/vagrant/plugins/commands/provision/command.rb +0 -34
- data/vendor/vagrant/plugins/commands/provision/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/reload/command.rb +0 -37
- data/vendor/vagrant/plugins/commands/reload/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/resume/command.rb +0 -25
- data/vendor/vagrant/plugins/commands/resume/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/ssh/command.rb +0 -66
- data/vendor/vagrant/plugins/commands/ssh/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/ssh_config/command.rb +0 -49
- data/vendor/vagrant/plugins/commands/ssh_config/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/status/command.rb +0 -39
- data/vendor/vagrant/plugins/commands/status/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/suspend/command.rb +0 -25
- data/vendor/vagrant/plugins/commands/suspend/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/up/command.rb +0 -45
- data/vendor/vagrant/plugins/commands/up/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/up/start_mixins.rb +0 -26
- data/vendor/vagrant/plugins/communicators/ssh/communicator.rb +0 -317
- data/vendor/vagrant/plugins/communicators/ssh/plugin.rb +0 -19
- data/vendor/vagrant/plugins/guests/arch/guest.rb +0 -41
- data/vendor/vagrant/plugins/guests/arch/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/debian/guest.rb +0 -72
- data/vendor/vagrant/plugins/guests/debian/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/fedora/guest.rb +0 -71
- data/vendor/vagrant/plugins/guests/fedora/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/freebsd/config.rb +0 -13
- data/vendor/vagrant/plugins/guests/freebsd/guest.rb +0 -70
- data/vendor/vagrant/plugins/guests/freebsd/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/gentoo/guest.rb +0 -51
- data/vendor/vagrant/plugins/guests/gentoo/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/linux/config.rb +0 -13
- data/vendor/vagrant/plugins/guests/linux/guest.rb +0 -118
- data/vendor/vagrant/plugins/guests/linux/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/openbsd/guest.rb +0 -13
- data/vendor/vagrant/plugins/guests/openbsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/redhat/guest.rb +0 -74
- data/vendor/vagrant/plugins/guests/redhat/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/solaris/config.rb +0 -18
- data/vendor/vagrant/plugins/guests/solaris/guest.rb +0 -73
- data/vendor/vagrant/plugins/guests/solaris/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/suse/guest.rb +0 -24
- data/vendor/vagrant/plugins/guests/suse/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/ubuntu/guest.rb +0 -44
- data/vendor/vagrant/plugins/guests/ubuntu/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/arch/host.rb +0 -68
- data/vendor/vagrant/plugins/hosts/arch/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/bsd/host.rb +0 -102
- data/vendor/vagrant/plugins/hosts/bsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/fedora/host.rb +0 -51
- data/vendor/vagrant/plugins/hosts/fedora/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/freebsd/host.rb +0 -43
- data/vendor/vagrant/plugins/hosts/freebsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/gentoo/host.rb +0 -24
- data/vendor/vagrant/plugins/hosts/gentoo/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/linux/host.rb +0 -95
- data/vendor/vagrant/plugins/hosts/linux/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/opensuse/host.rb +0 -34
- data/vendor/vagrant/plugins/hosts/opensuse/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/windows/host.rb +0 -17
- data/vendor/vagrant/plugins/hosts/windows/plugin.rb +0 -15
- data/vendor/vagrant/plugins/kernel_v1/config/nfs.rb +0 -20
- data/vendor/vagrant/plugins/kernel_v1/config/package.rb +0 -17
- data/vendor/vagrant/plugins/kernel_v1/config/ssh.rb +0 -46
- data/vendor/vagrant/plugins/kernel_v1/config/vagrant.rb +0 -31
- data/vendor/vagrant/plugins/kernel_v1/config/vm.rb +0 -184
- data/vendor/vagrant/plugins/kernel_v1/plugin.rb +0 -44
- data/vendor/vagrant/plugins/kernel_v2/config/nfs.rb +0 -10
- data/vendor/vagrant/plugins/kernel_v2/config/package.rb +0 -9
- data/vendor/vagrant/plugins/kernel_v2/config/ssh.rb +0 -35
- data/vendor/vagrant/plugins/kernel_v2/config/vagrant.rb +0 -9
- data/vendor/vagrant/plugins/kernel_v2/config/vm.rb +0 -314
- data/vendor/vagrant/plugins/kernel_v2/config/vm_provisioner.rb +0 -40
- data/vendor/vagrant/plugins/kernel_v2/config/vm_subvm.rb +0 -30
- data/vendor/vagrant/plugins/kernel_v2/plugin.rb +0 -44
- data/vendor/vagrant/plugins/providers/virtualbox/action/boot.rb +0 -49
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_accessible.rb +0 -23
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_created.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_guest_additions.rb +0 -45
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_running.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_virtualbox.rb +0 -22
- data/vendor/vagrant/plugins/providers/virtualbox/action/clean_machine_folder.rb +0 -43
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_forwarded_ports.rb +0 -18
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_network_interfaces.rb +0 -31
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_shared_folders.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/created.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/customize.rb +0 -36
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy.rb +0 -19
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy_confirm.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/discard_state.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/export.rb +0 -57
- data/vendor/vagrant/plugins/providers/virtualbox/action/forced_halt.rb +0 -25
- data/vendor/vagrant/plugins/providers/virtualbox/action/forward_ports.rb +0 -79
- data/vendor/vagrant/plugins/providers/virtualbox/action/import.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_paused.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_running.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_saved.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/match_mac_address.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_not_created.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_not_running.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_will_not_destroy.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/network.rb +0 -366
- data/vendor/vagrant/plugins/providers/virtualbox/action/package.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/package_vagrantfile.rb +0 -33
- data/vendor/vagrant/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb +0 -35
- data/vendor/vagrant/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/prune_nfs_exports.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/resume.rb +0 -25
- data/vendor/vagrant/plugins/providers/virtualbox/action/sane_defaults.rb +0 -87
- data/vendor/vagrant/plugins/providers/virtualbox/action/set_name.rb +0 -40
- data/vendor/vagrant/plugins/providers/virtualbox/action/setup_package_files.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/share_folders.rb +0 -113
- data/vendor/vagrant/plugins/providers/virtualbox/action/suspend.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action.rb +0 -308
- data/vendor/vagrant/plugins/providers/virtualbox/config.rb +0 -82
- data/vendor/vagrant/plugins/providers/virtualbox/driver/base.rb +0 -344
- data/vendor/vagrant/plugins/providers/virtualbox/driver/meta.rb +0 -141
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_0.rb +0 -481
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_1.rb +0 -481
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_2.rb +0 -471
- data/vendor/vagrant/plugins/providers/virtualbox/model/forwarded_port.rb +0 -58
- data/vendor/vagrant/plugins/providers/virtualbox/plugin.rb +0 -42
- data/vendor/vagrant/plugins/providers/virtualbox/provider.rb +0 -92
- data/vendor/vagrant/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +0 -31
- data/vendor/vagrant/plugins/provisioners/chef/config/base.rb +0 -65
- data/vendor/vagrant/plugins/provisioners/chef/config/chef_client.rb +0 -39
- data/vendor/vagrant/plugins/provisioners/chef/config/chef_solo.rb +0 -87
- data/vendor/vagrant/plugins/provisioners/chef/plugin.rb +0 -33
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/base.rb +0 -91
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/chef_client.rb +0 -103
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/chef_solo.rb +0 -182
- data/vendor/vagrant/plugins/provisioners/puppet/config/puppet.rb +0 -70
- data/vendor/vagrant/plugins/provisioners/puppet/config/puppet_server.rb +0 -16
- data/vendor/vagrant/plugins/provisioners/puppet/plugin.rb +0 -33
- data/vendor/vagrant/plugins/provisioners/puppet/provisioner/puppet.rb +0 -110
- data/vendor/vagrant/plugins/provisioners/puppet/provisioner/puppet_server.rb +0 -67
- data/vendor/vagrant/plugins/provisioners/shell/config.rb +0 -46
- data/vendor/vagrant/plugins/provisioners/shell/plugin.rb +0 -23
- data/vendor/vagrant/plugins/provisioners/shell/provisioner.rb +0 -66
- data/vendor/vagrant/tasks/acceptance.rake +0 -113
- data/vendor/vagrant/tasks/bundler.rake +0 -3
- data/vendor/vagrant/tasks/test.rake +0 -20
- data/vendor/vagrant/templates/commands/init/Vagrantfile.erb +0 -111
- data/vendor/vagrant/templates/commands/ssh_config/config.erb +0 -16
- data/vendor/vagrant/templates/config/messages.erb +0 -14
- data/vendor/vagrant/templates/config/validation_failed.erb +0 -7
- data/vendor/vagrant/templates/guests/arch/network_dhcp.erb +0 -4
- data/vendor/vagrant/templates/guests/arch/network_static.erb +0 -6
- data/vendor/vagrant/templates/guests/debian/network_dhcp.erb +0 -11
- data/vendor/vagrant/templates/guests/debian/network_static.erb +0 -7
- data/vendor/vagrant/templates/guests/fedora/network_dhcp.erb +0 -6
- data/vendor/vagrant/templates/guests/fedora/network_static.erb +0 -13
- data/vendor/vagrant/templates/guests/freebsd/network_dhcp.erb +0 -3
- data/vendor/vagrant/templates/guests/freebsd/network_static.erb +0 -3
- data/vendor/vagrant/templates/guests/gentoo/network_dhcp.erb +0 -4
- data/vendor/vagrant/templates/guests/gentoo/network_static.erb +0 -4
- data/vendor/vagrant/templates/guests/redhat/network_dhcp.erb +0 -6
- data/vendor/vagrant/templates/guests/redhat/network_static.erb +0 -7
- data/vendor/vagrant/templates/locales/en.yml +0 -993
- data/vendor/vagrant/templates/nfs/exports.erb +0 -5
- data/vendor/vagrant/templates/nfs/exports_freebsd.erb +0 -5
- data/vendor/vagrant/templates/nfs/exports_linux.erb +0 -5
- data/vendor/vagrant/templates/package_Vagrantfile.erb +0 -11
- data/vendor/vagrant/templates/provisioners/chef_client/client.erb +0 -32
- data/vendor/vagrant/templates/provisioners/chef_solo/solo.erb +0 -25
- data/vendor/vagrant/templates/rgloader.rb +0 -9
- data/vendor/vagrant/test/acceptance/base.rb +0 -48
- data/vendor/vagrant/test/acceptance/box_test.rb +0 -99
- data/vendor/vagrant/test/acceptance/destroy_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/halt_test.rb +0 -72
- data/vendor/vagrant/test/acceptance/init_test.rb +0 -33
- data/vendor/vagrant/test/acceptance/networking/host_only_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/networking/port_forward_test.rb +0 -125
- data/vendor/vagrant/test/acceptance/package_test.rb +0 -46
- data/vendor/vagrant/test/acceptance/provisioning/basic_test.rb +0 -61
- data/vendor/vagrant/test/acceptance/provisioning/chef_solo_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/provisioning/shell_test.rb +0 -53
- data/vendor/vagrant/test/acceptance/resume_test.rb +0 -17
- data/vendor/vagrant/test/acceptance/shared_folders_test.rb +0 -84
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_basic/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +0 -5
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_json/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +0 -6
- data/vendor/vagrant/test/acceptance/skeletons/provisioner_multi/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +0 -5
- data/vendor/vagrant/test/acceptance/ssh_test.rb +0 -46
- data/vendor/vagrant/test/acceptance/support/config.rb +0 -42
- data/vendor/vagrant/test/acceptance/support/isolated_environment.rb +0 -118
- data/vendor/vagrant/test/acceptance/support/matchers/have_color.rb +0 -9
- data/vendor/vagrant/test/acceptance/support/matchers/match_output.rb +0 -14
- data/vendor/vagrant/test/acceptance/support/matchers/succeed.rb +0 -14
- data/vendor/vagrant/test/acceptance/support/network_tests.rb +0 -29
- data/vendor/vagrant/test/acceptance/support/output.rb +0 -95
- data/vendor/vagrant/test/acceptance/support/shared/base_context.rb +0 -72
- data/vendor/vagrant/test/acceptance/support/shared/command_examples.rb +0 -33
- data/vendor/vagrant/test/acceptance/support/virtualbox.rb +0 -36
- data/vendor/vagrant/test/acceptance/suspend_test.rb +0 -56
- data/vendor/vagrant/test/acceptance/up_basic_test.rb +0 -33
- data/vendor/vagrant/test/acceptance/up_with_box_url.rb +0 -40
- data/vendor/vagrant/test/acceptance/vagrant_test.rb +0 -47
- data/vendor/vagrant/test/acceptance/version_test.rb +0 -15
- data/vendor/vagrant/test/config/acceptance_boxes.yml +0 -7
- data/vendor/vagrant/test/support/isolated_environment.rb +0 -46
- data/vendor/vagrant/test/support/tempdir.rb +0 -43
- data/vendor/vagrant/test/unit/base.rb +0 -27
- data/vendor/vagrant/test/unit/support/dummy_provider.rb +0 -16
- data/vendor/vagrant/test/unit/support/isolated_environment.rb +0 -177
- data/vendor/vagrant/test/unit/support/shared/base_context.rb +0 -104
- data/vendor/vagrant/test/unit/vagrant/action/builder_test.rb +0 -196
- data/vendor/vagrant/test/unit/vagrant/action/builtin/call_test.rb +0 -145
- data/vendor/vagrant/test/unit/vagrant/action/builtin/confirm_test.rb +0 -36
- data/vendor/vagrant/test/unit/vagrant/action/builtin/env_set_test.rb +0 -20
- data/vendor/vagrant/test/unit/vagrant/action/builtin/graceful_halt_test.rb +0 -61
- data/vendor/vagrant/test/unit/vagrant/action/builtin/lock_test.rb +0 -98
- data/vendor/vagrant/test/unit/vagrant/action/builtin/ssh_exec_test.rb +0 -57
- data/vendor/vagrant/test/unit/vagrant/action/hook_test.rb +0 -101
- data/vendor/vagrant/test/unit/vagrant/action/runner_test.rb +0 -71
- data/vendor/vagrant/test/unit/vagrant/action/warden_test.rb +0 -92
- data/vendor/vagrant/test/unit/vagrant/box_collection_test.rb +0 -224
- data/vendor/vagrant/test/unit/vagrant/box_test.rb +0 -109
- data/vendor/vagrant/test/unit/vagrant/cli_test.rb +0 -27
- data/vendor/vagrant/test/unit/vagrant/config/loader_test.rb +0 -184
- data/vendor/vagrant/test/unit/vagrant/config/v1/dummy_config_test.rb +0 -24
- data/vendor/vagrant/test/unit/vagrant/config/v1/loader_test.rb +0 -145
- data/vendor/vagrant/test/unit/vagrant/config/v1/root_test.rb +0 -40
- data/vendor/vagrant/test/unit/vagrant/config/v2/dummy_config_test.rb +0 -24
- data/vendor/vagrant/test/unit/vagrant/config/v2/loader_test.rb +0 -151
- data/vendor/vagrant/test/unit/vagrant/config/v2/root_test.rb +0 -97
- data/vendor/vagrant/test/unit/vagrant/config/v2/util_test.rb +0 -21
- data/vendor/vagrant/test/unit/vagrant/config_test.rb +0 -66
- data/vendor/vagrant/test/unit/vagrant/downloaders/base_test.rb +0 -14
- data/vendor/vagrant/test/unit/vagrant/downloaders/file_test.rb +0 -87
- data/vendor/vagrant/test/unit/vagrant/downloaders/http_test.rb +0 -23
- data/vendor/vagrant/test/unit/vagrant/environment_test.rb +0 -571
- data/vendor/vagrant/test/unit/vagrant/hosts_test.rb +0 -37
- data/vendor/vagrant/test/unit/vagrant/machine_state_test.rb +0 -26
- data/vendor/vagrant/test/unit/vagrant/machine_test.rb +0 -418
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/command_test.rb +0 -143
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/communicator_test.rb +0 -9
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/config_test.rb +0 -50
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/host_test.rb +0 -5
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/manager_test.rb +0 -114
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/plugin_test.rb +0 -267
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/provider_test.rb +0 -18
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/command_test.rb +0 -238
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/communicator_test.rb +0 -9
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/components_test.rb +0 -17
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/config_test.rb +0 -60
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/host_test.rb +0 -5
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/manager_test.rb +0 -157
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/plugin_test.rb +0 -287
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/provider_test.rb +0 -18
- data/vendor/vagrant/test/unit/vagrant/registry_test.rb +0 -128
- data/vendor/vagrant/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +0 -16
- data/vendor/vagrant/test/unit/vagrant/util/file_checksum_test.rb +0 -23
- data/vendor/vagrant/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +0 -38
- data/vendor/vagrant/test/unit/vagrant/util/is_port_open_test.rb +0 -53
- data/vendor/vagrant/test/unit/vagrant/util/line_endings_helper_test.rb +0 -16
- data/vendor/vagrant/test/unit/vagrant/util/network_ip_test.rb +0 -17
- data/vendor/vagrant/test/unit/vagrant/util/retryable_test.rb +0 -106
- data/vendor/vagrant/test/unit/vagrant/util/scoped_hash_override_test.rb +0 -48
- data/vendor/vagrant/test/unit/vagrant/util/ssh_test.rb +0 -30
- data/vendor/vagrant/test/unit/vagrant/util/string_block_editor_test.rb +0 -98
- data/vendor/vagrant/test/unit/vagrant/util/which_test.rb +0 -43
- data/vendor/vagrant/test/unit/vagrant_test.rb +0 -56
- data/vendor/vagrant/vagrant.gemspec +0 -69
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
require "log4r"
|
|
2
|
-
|
|
3
|
-
module Vagrant
|
|
4
|
-
module Action
|
|
5
|
-
module Builtin
|
|
6
|
-
# This class creates a multi-process lock using `flock`. The lock
|
|
7
|
-
# is active for the remainder of the middleware stack.
|
|
8
|
-
class Lock
|
|
9
|
-
def initialize(app, env, options=nil)
|
|
10
|
-
@app = app
|
|
11
|
-
@logger = Log4r::Logger.new("vagrant::action::builtin::lock")
|
|
12
|
-
@options ||= options || {}
|
|
13
|
-
raise ArgumentError, "Please specify a lock path" if !@options[:path]
|
|
14
|
-
raise ArgumentError, "Please specify an exception." if !@options[:exception]
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def call(env)
|
|
18
|
-
lock_path = @options[:path]
|
|
19
|
-
lock_path = lock_path.call(env) if lock_path.is_a?(Proc)
|
|
20
|
-
|
|
21
|
-
env_key = "has_lock_#{lock_path}"
|
|
22
|
-
|
|
23
|
-
if !env[env_key]
|
|
24
|
-
# If we already have the key in our environment we assume the
|
|
25
|
-
# lock is held by our middleware stack already and we allow
|
|
26
|
-
# nesting.
|
|
27
|
-
File.open(lock_path, "w+") do |f|
|
|
28
|
-
# The file locking fails only if it returns "false." If it
|
|
29
|
-
# succeeds it returns a 0, so we must explicitly check for
|
|
30
|
-
# the proper error case.
|
|
31
|
-
@logger.info("Locking: #{lock_path}")
|
|
32
|
-
if f.flock(File::LOCK_EX | File::LOCK_NB) === false
|
|
33
|
-
exception = @options[:exception]
|
|
34
|
-
exception = exception.call(env) if exception.is_a?(Proc)
|
|
35
|
-
raise exception
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# Set that we gained the lock and call deeper into the
|
|
39
|
-
# middleware, but make sure we UNSET the lock when we leave.
|
|
40
|
-
begin
|
|
41
|
-
env[env_key] = true
|
|
42
|
-
@app.call(env)
|
|
43
|
-
ensure
|
|
44
|
-
@logger.info("Unlocking: #{lock_path}")
|
|
45
|
-
env[env_key] = false
|
|
46
|
-
f.flock(File::LOCK_UN)
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
else
|
|
50
|
-
# Just call up the middleware because we already hold the lock
|
|
51
|
-
@app.call(env)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
require 'digest/md5'
|
|
2
|
-
require 'fileutils'
|
|
3
|
-
require 'pathname'
|
|
4
|
-
|
|
5
|
-
require "log4r"
|
|
6
|
-
|
|
7
|
-
module Vagrant
|
|
8
|
-
module Action
|
|
9
|
-
module Builtin
|
|
10
|
-
# This built-in middleware exports and mounts NFS shared folders.
|
|
11
|
-
#
|
|
12
|
-
# To use this middleware, two configuration parameters must be given
|
|
13
|
-
# via the environment hash:
|
|
14
|
-
#
|
|
15
|
-
# - `:nfs_host_ip` - The IP of where to mount the NFS folder from.
|
|
16
|
-
# - `:nfs_machine_ip` - The IP of the machine where the NFS folder
|
|
17
|
-
# will be mounted.
|
|
18
|
-
#
|
|
19
|
-
class NFS
|
|
20
|
-
def initialize(app, env)
|
|
21
|
-
@app = app
|
|
22
|
-
@logger = Log4r::Logger.new("vagrant::action::builtin::nfs")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def call(env)
|
|
26
|
-
# We forward things along first. We do everything on the tail
|
|
27
|
-
# end of the middleware call.
|
|
28
|
-
@app.call(env)
|
|
29
|
-
|
|
30
|
-
# Used by prepare_permission, so we need to save it
|
|
31
|
-
@env = env
|
|
32
|
-
|
|
33
|
-
folders = {}
|
|
34
|
-
env[:machine].config.vm.synced_folders.each do |id, opts|
|
|
35
|
-
# If this synced folder doesn't enable NFS, ignore it.
|
|
36
|
-
next if !opts[:nfs]
|
|
37
|
-
|
|
38
|
-
# Expand the host path, create it if we have to and
|
|
39
|
-
# store away the folder.
|
|
40
|
-
hostpath = Pathname.new(opts[:hostpath]).expand_path(env[:root_path])
|
|
41
|
-
|
|
42
|
-
if !hostpath.directory? && opts[:create]
|
|
43
|
-
# Host path doesn't exist, so let's create it.
|
|
44
|
-
@logger.debug("Host path doesn't exist, creating: #{hostpath}")
|
|
45
|
-
|
|
46
|
-
begin
|
|
47
|
-
FileUtils.mkpath(hostpath)
|
|
48
|
-
rescue Errno::EACCES
|
|
49
|
-
raise Vagrant::Errors::SharedFolderCreateFailed,
|
|
50
|
-
:path => hostpath.to_s
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Set the hostpath back on the options and save it
|
|
55
|
-
opts[:hostpath] = hostpath.to_s
|
|
56
|
-
folders[id] = opts
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
if !folders.empty?
|
|
60
|
-
raise Errors::NFSNoHostIP if !env[:nfs_host_ip]
|
|
61
|
-
raise Errors::NFSNoGuestIP if !env[:nfs_machine_ip]
|
|
62
|
-
|
|
63
|
-
# Prepare the folder, this means setting up various options
|
|
64
|
-
# and such on the folder itself.
|
|
65
|
-
folders.each { |id, opts| prepare_folder(opts) }
|
|
66
|
-
|
|
67
|
-
# Export the folders
|
|
68
|
-
env[:ui].info I18n.t("vagrant.actions.vm.nfs.exporting")
|
|
69
|
-
env[:host].nfs_export(env[:machine].id, env[:nfs_machine_ip], folders)
|
|
70
|
-
|
|
71
|
-
# Mount
|
|
72
|
-
env[:ui].info I18n.t("vagrant.actions.vm.nfs.mounting")
|
|
73
|
-
|
|
74
|
-
# Only mount folders that have a guest path specified.
|
|
75
|
-
mount_folders = {}
|
|
76
|
-
folders.each do |id, opts|
|
|
77
|
-
mount_folders[id] = opts.dup if opts[:guestpath]
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Mount them!
|
|
81
|
-
env[:machine].guest.mount_nfs(env[:nfs_host_ip], mount_folders)
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
protected
|
|
86
|
-
|
|
87
|
-
def prepare_folder(opts)
|
|
88
|
-
opts[:map_uid] = prepare_permission(:uid, opts)
|
|
89
|
-
opts[:map_gid] = prepare_permission(:gid, opts)
|
|
90
|
-
opts[:nfs_version] ||= 3
|
|
91
|
-
|
|
92
|
-
# The poor man's UUID. An MD5 hash here is sufficient since
|
|
93
|
-
# we need a 32 character "uuid" to represent the filesystem
|
|
94
|
-
# of an export. Hashing the host path is safe because two of
|
|
95
|
-
# the same host path will hash to the same fsid.
|
|
96
|
-
opts[:uuid] = Digest::MD5.hexdigest(opts[:hostpath])
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Prepares the UID/GID settings for a single folder.
|
|
100
|
-
def prepare_permission(perm, opts)
|
|
101
|
-
key = "map_#{perm}".to_sym
|
|
102
|
-
return nil if opts.has_key?(key) && opts[key].nil?
|
|
103
|
-
|
|
104
|
-
# The options on the hash get priority, then the default
|
|
105
|
-
# values
|
|
106
|
-
value = opts.has_key?(key) ? opts[key] : @env[:machine].config.nfs.send(key)
|
|
107
|
-
return value if value != :auto
|
|
108
|
-
|
|
109
|
-
# Get UID/GID from folder if we've made it this far
|
|
110
|
-
# (value == :auto)
|
|
111
|
-
stat = File.stat(opts[:hostpath])
|
|
112
|
-
return stat.send(perm)
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
require "log4r"
|
|
2
|
-
|
|
3
|
-
module Vagrant
|
|
4
|
-
module Action
|
|
5
|
-
module Builtin
|
|
6
|
-
# This class will run the configured provisioners against the
|
|
7
|
-
# machine.
|
|
8
|
-
#
|
|
9
|
-
# This action should be placed BEFORE the machine is booted so it
|
|
10
|
-
# can do some setup, and then run again (on the return path) against
|
|
11
|
-
# a running machine.
|
|
12
|
-
class Provision
|
|
13
|
-
def initialize(app, env)
|
|
14
|
-
@app = app
|
|
15
|
-
@logger = Log4r::Logger.new("vagrant::action::builtin::provision")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def call(env)
|
|
19
|
-
# Check if we're even provisioning things.
|
|
20
|
-
enabled = true
|
|
21
|
-
enabled = env[:provision_enabled] if env.has_key?(:provision_enabled)
|
|
22
|
-
|
|
23
|
-
# This keeps track of a mapping between provisioner and type
|
|
24
|
-
type_map = {}
|
|
25
|
-
|
|
26
|
-
# Get all the configured provisioners
|
|
27
|
-
provisioners = env[:machine].config.vm.provisioners.map do |provisioner|
|
|
28
|
-
# Instantiate the provisioner
|
|
29
|
-
klass = Vagrant.plugin("2").manager.provisioners[provisioner.name]
|
|
30
|
-
result = klass.new(env[:machine], provisioner.config)
|
|
31
|
-
|
|
32
|
-
# Store in the type map so that --provision-with works properly
|
|
33
|
-
type_map[result] = provisioner.name
|
|
34
|
-
|
|
35
|
-
# Return the result
|
|
36
|
-
result
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# Ask the provisioners to modify the configuration if needed
|
|
40
|
-
provisioners.each do |p|
|
|
41
|
-
p.configure(env[:machine].config)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Continue, we need the VM to be booted.
|
|
45
|
-
@app.call(env)
|
|
46
|
-
|
|
47
|
-
# Actually provision if we enabled it
|
|
48
|
-
if enabled
|
|
49
|
-
provisioners.each do |p|
|
|
50
|
-
next if env[:provision_types] && \
|
|
51
|
-
!env[:provision_types].include?(type_map[p])
|
|
52
|
-
|
|
53
|
-
run_provisioner(env, p)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# This is pulled out into a seperate method so that users can
|
|
59
|
-
# subclass and implement custom behavior if they'd like around
|
|
60
|
-
# this step.
|
|
61
|
-
def run_provisioner(env, p)
|
|
62
|
-
env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning",
|
|
63
|
-
:provisioner => p.class))
|
|
64
|
-
|
|
65
|
-
p.provision
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require "log4r"
|
|
2
|
-
|
|
3
|
-
module Vagrant
|
|
4
|
-
module Action
|
|
5
|
-
module Builtin
|
|
6
|
-
# This middleware sets the hostname of the guest according to the
|
|
7
|
-
# "vm.hostname" configuration parameter if it is set. This middleware
|
|
8
|
-
# should be placed such that the after the @app.call, a booted machine
|
|
9
|
-
# is available (this generally means BEFORE the boot middleware).
|
|
10
|
-
class SetHostname
|
|
11
|
-
def initialize(app, env)
|
|
12
|
-
@app = app
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def call(env)
|
|
16
|
-
@app.call(env)
|
|
17
|
-
|
|
18
|
-
hostname = env[:machine].config.vm.hostname
|
|
19
|
-
if !hostname.nil?
|
|
20
|
-
env[:ui].info I18n.t("vagrant.actions.vm.hostname.setting")
|
|
21
|
-
env[:machine].guest.change_host_name(hostname)
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require "pathname"
|
|
2
|
-
|
|
3
|
-
require "vagrant/util/ssh"
|
|
4
|
-
|
|
5
|
-
module Vagrant
|
|
6
|
-
module Action
|
|
7
|
-
module Builtin
|
|
8
|
-
# This class will exec into a full fledged SSH console into the
|
|
9
|
-
# remote machine. This middleware assumes that the VM is running and
|
|
10
|
-
# ready for SSH, and uses the {Machine#ssh_info} method to retrieve
|
|
11
|
-
# SSH information necessary to connect.
|
|
12
|
-
#
|
|
13
|
-
# Note: If there are any middleware after `SSHExec`, they will **not**
|
|
14
|
-
# run, since exec replaces the currently running process.
|
|
15
|
-
class SSHExec
|
|
16
|
-
# For quick access to the `SSH` class.
|
|
17
|
-
include Vagrant::Util
|
|
18
|
-
|
|
19
|
-
def initialize(app, env)
|
|
20
|
-
@app = app
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def call(env)
|
|
24
|
-
# Grab the SSH info from the machine
|
|
25
|
-
info = env[:machine].ssh_info
|
|
26
|
-
|
|
27
|
-
# If the result is nil, then the machine is telling us that it is
|
|
28
|
-
# not yet ready for SSH, so we raise this exception.
|
|
29
|
-
raise Errors::SSHNotReady if info.nil?
|
|
30
|
-
|
|
31
|
-
if info[:private_key_path]
|
|
32
|
-
# Check the SSH key permissions
|
|
33
|
-
SSH.check_key_permissions(Pathname.new(info[:private_key_path]))
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Exec!
|
|
37
|
-
SSH.exec(info, env[:ssh_opts])
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
require "log4r"
|
|
2
|
-
|
|
3
|
-
module Vagrant
|
|
4
|
-
module Action
|
|
5
|
-
module Builtin
|
|
6
|
-
# This class will run a single command on the remote machine and will
|
|
7
|
-
# mirror the output to the UI. The resulting exit status of the command
|
|
8
|
-
# will exist in the `:ssh_run_exit_status` key in the environment.
|
|
9
|
-
class SSHRun
|
|
10
|
-
def initialize(app, env)
|
|
11
|
-
@app = app
|
|
12
|
-
@logger = Log4r::Logger.new("vagrant::action::builtin::ssh_run")
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def call(env)
|
|
16
|
-
command = env[:ssh_run_command]
|
|
17
|
-
|
|
18
|
-
@logger.debug("Executing command: #{command}")
|
|
19
|
-
exit_status = 0
|
|
20
|
-
exit_status = env[:machine].communicate.execute(command, :error_check => false) do |type, data|
|
|
21
|
-
# Determine the proper channel to send the output onto depending
|
|
22
|
-
# on the type of data we are receiving.
|
|
23
|
-
channel = type == :stdout ? :out : :error
|
|
24
|
-
|
|
25
|
-
# Print the output as it comes in, but don't prefix it and don't
|
|
26
|
-
# force a new line so that the output is properly preserved however
|
|
27
|
-
# it may be formatted.
|
|
28
|
-
env[:ui].info(data.to_s,
|
|
29
|
-
:prefix => false,
|
|
30
|
-
:new_line => false,
|
|
31
|
-
:channel => channel)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Set the exit status on a known environmental variable
|
|
35
|
-
env[:ssh_run_exit_status] = exit_status
|
|
36
|
-
|
|
37
|
-
# Call the next middleware
|
|
38
|
-
@app.call(env)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
require 'fileutils'
|
|
2
|
-
|
|
3
|
-
require 'vagrant/util/subprocess'
|
|
4
|
-
|
|
5
|
-
module Vagrant
|
|
6
|
-
module Action
|
|
7
|
-
module General
|
|
8
|
-
# A general packaging (tar) middleware. Given the following options,
|
|
9
|
-
# it will do the right thing:
|
|
10
|
-
#
|
|
11
|
-
# * package.output - The filename of the outputted package.
|
|
12
|
-
# * package.include - An array of files to include in the package.
|
|
13
|
-
# * package.directory - The directory which contains the contents to
|
|
14
|
-
# compress into the package.
|
|
15
|
-
#
|
|
16
|
-
# This middleware always produces the final file in the current working
|
|
17
|
-
# directory (FileUtils.pwd)
|
|
18
|
-
class Package
|
|
19
|
-
include Util
|
|
20
|
-
|
|
21
|
-
def initialize(app, env)
|
|
22
|
-
@app = app
|
|
23
|
-
|
|
24
|
-
env["package.files"] ||= {}
|
|
25
|
-
env["package.output"] ||= env["global_config"].package.name
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def call(env)
|
|
29
|
-
@env = env
|
|
30
|
-
|
|
31
|
-
raise Errors::PackageOutputDirectory if File.directory?(tar_path)
|
|
32
|
-
raise Errors::PackageOutputExists if File.exist?(tar_path)
|
|
33
|
-
raise Errors::PackageRequiresDirectory if !env["package.directory"] ||
|
|
34
|
-
!File.directory?(env["package.directory"])
|
|
35
|
-
|
|
36
|
-
compress
|
|
37
|
-
|
|
38
|
-
@app.call(env)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def recover(env)
|
|
42
|
-
# There are certain exceptions that we don't delete the file for.
|
|
43
|
-
ignore_exc = [Errors::PackageOutputDirectory, Errors::PackageOutputExists]
|
|
44
|
-
ignore_exc.each do |exc|
|
|
45
|
-
return if env["vagrant.error"].is_a?(exc)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Cleanup any packaged files if the packaging failed at some point.
|
|
49
|
-
File.delete(tar_path) if File.exist?(tar_path)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# This method copies the include files (passed in via command line)
|
|
53
|
-
# to the temporary directory so they are included in a sub-folder within
|
|
54
|
-
# the actual box
|
|
55
|
-
def copy_include_files
|
|
56
|
-
include_directory = Pathname.new(@env["package.directory"]).join("include")
|
|
57
|
-
|
|
58
|
-
@env["package.files"].each do |from, dest|
|
|
59
|
-
# We place the file in the include directory
|
|
60
|
-
to = include_directory.join(dest)
|
|
61
|
-
|
|
62
|
-
@env[:ui].info I18n.t("vagrant.actions.general.package.packaging", :file => from)
|
|
63
|
-
FileUtils.mkdir_p(to.parent)
|
|
64
|
-
|
|
65
|
-
# Copy direcotry contents recursively.
|
|
66
|
-
if File.directory?(from)
|
|
67
|
-
FileUtils.cp_r(Dir.glob(from), to.parent, :preserve => true)
|
|
68
|
-
else
|
|
69
|
-
FileUtils.cp(from, to, :preserve => true)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# Compress the exported file into a package
|
|
75
|
-
def compress
|
|
76
|
-
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing", :tar_path => tar_path)
|
|
77
|
-
|
|
78
|
-
# Copy over the included files
|
|
79
|
-
copy_include_files
|
|
80
|
-
|
|
81
|
-
# Get the output path. We have to do this up here so that the
|
|
82
|
-
# pwd returns the proper thing.
|
|
83
|
-
output_path = tar_path.to_s
|
|
84
|
-
|
|
85
|
-
# Switch into that directory and package everything up
|
|
86
|
-
Dir.chdir(@env["package.directory"]) do
|
|
87
|
-
# Find all the files in our current directory and tar it up!
|
|
88
|
-
files = Dir.glob(File.join(".", "**", "*"))
|
|
89
|
-
|
|
90
|
-
# Package!
|
|
91
|
-
Util::Subprocess.execute("bsdtar", "-czf", output_path, *files)
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Path to the final box output file
|
|
96
|
-
def tar_path
|
|
97
|
-
File.expand_path(@env["package.output"], FileUtils.pwd)
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|