fixed-vagrant 0.7.4.dev
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +15 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +272 -0
- data/Gemfile +21 -0
- data/LICENSE +21 -0
- data/README.md +75 -0
- data/Rakefile +22 -0
- data/bin/vagrant +22 -0
- data/config/default.rb +39 -0
- data/contrib/README.md +12 -0
- data/contrib/emacs/vagrant.el +8 -0
- data/contrib/vim/vagrantfile.vim +9 -0
- data/keys/README.md +17 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.ppk +26 -0
- data/keys/vagrant.pub +1 -0
- data/lib/vagrant.rb +42 -0
- data/lib/vagrant/action.rb +134 -0
- data/lib/vagrant/action/box.rb +11 -0
- data/lib/vagrant/action/box/destroy.rb +21 -0
- data/lib/vagrant/action/box/download.rb +72 -0
- data/lib/vagrant/action/box/package.rb +19 -0
- data/lib/vagrant/action/box/unpackage.rb +55 -0
- data/lib/vagrant/action/box/verify.rb +23 -0
- data/lib/vagrant/action/builder.rb +124 -0
- data/lib/vagrant/action/builtin.rb +104 -0
- data/lib/vagrant/action/env.rb +7 -0
- data/lib/vagrant/action/env/set.rb +18 -0
- data/lib/vagrant/action/environment.rb +50 -0
- data/lib/vagrant/action/general.rb +8 -0
- data/lib/vagrant/action/general/package.rb +109 -0
- data/lib/vagrant/action/general/validate.rb +19 -0
- data/lib/vagrant/action/vm.rb +31 -0
- data/lib/vagrant/action/vm/boot.rb +48 -0
- data/lib/vagrant/action/vm/check_box.rb +28 -0
- data/lib/vagrant/action/vm/check_guest_additions.rb +30 -0
- data/lib/vagrant/action/vm/clean_machine_folder.rb +43 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +39 -0
- data/lib/vagrant/action/vm/clear_nfs_exports.rb +20 -0
- data/lib/vagrant/action/vm/clear_shared_folders.rb +32 -0
- data/lib/vagrant/action/vm/customize.rb +21 -0
- data/lib/vagrant/action/vm/destroy.rb +19 -0
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +30 -0
- data/lib/vagrant/action/vm/discard_state.rb +22 -0
- data/lib/vagrant/action/vm/export.rb +52 -0
- data/lib/vagrant/action/vm/forward_ports.rb +134 -0
- data/lib/vagrant/action/vm/forward_ports_helpers.rb +28 -0
- data/lib/vagrant/action/vm/halt.rb +29 -0
- data/lib/vagrant/action/vm/host_name.rb +21 -0
- data/lib/vagrant/action/vm/import.rb +35 -0
- data/lib/vagrant/action/vm/match_mac_address.rb +21 -0
- data/lib/vagrant/action/vm/network.rb +139 -0
- data/lib/vagrant/action/vm/nfs.rb +159 -0
- data/lib/vagrant/action/vm/nfs_helpers.rb +11 -0
- data/lib/vagrant/action/vm/package.rb +23 -0
- data/lib/vagrant/action/vm/package_vagrantfile.rb +33 -0
- data/lib/vagrant/action/vm/provision.rb +41 -0
- data/lib/vagrant/action/vm/resume.rb +20 -0
- data/lib/vagrant/action/vm/share_folders.rb +70 -0
- data/lib/vagrant/action/vm/suspend.rb +20 -0
- data/lib/vagrant/action/warden.rb +79 -0
- data/lib/vagrant/box.rb +90 -0
- data/lib/vagrant/box_collection.rb +53 -0
- data/lib/vagrant/cli.rb +55 -0
- data/lib/vagrant/command.rb +25 -0
- data/lib/vagrant/command/base.rb +106 -0
- data/lib/vagrant/command/box.rb +33 -0
- data/lib/vagrant/command/destroy.rb +17 -0
- data/lib/vagrant/command/group_base.rb +107 -0
- data/lib/vagrant/command/halt.rb +18 -0
- data/lib/vagrant/command/helpers.rb +33 -0
- data/lib/vagrant/command/init.rb +14 -0
- data/lib/vagrant/command/named_base.rb +14 -0
- data/lib/vagrant/command/package.rb +41 -0
- data/lib/vagrant/command/provision.rb +17 -0
- data/lib/vagrant/command/reload.rb +17 -0
- data/lib/vagrant/command/resume.rb +17 -0
- data/lib/vagrant/command/ssh.rb +42 -0
- data/lib/vagrant/command/ssh_config.rb +26 -0
- data/lib/vagrant/command/status.rb +22 -0
- data/lib/vagrant/command/suspend.rb +17 -0
- data/lib/vagrant/command/up.rb +19 -0
- data/lib/vagrant/command/upgrade_to_060.rb +45 -0
- data/lib/vagrant/command/version.rb +13 -0
- data/lib/vagrant/config.rb +123 -0
- data/lib/vagrant/config/base.rb +85 -0
- data/lib/vagrant/config/error_recorder.rb +19 -0
- data/lib/vagrant/config/nfs.rb +10 -0
- data/lib/vagrant/config/package.rb +9 -0
- data/lib/vagrant/config/ssh.rb +33 -0
- data/lib/vagrant/config/top.rb +61 -0
- data/lib/vagrant/config/vagrant.rb +16 -0
- data/lib/vagrant/config/vm.rb +137 -0
- data/lib/vagrant/config/vm/provisioner.rb +56 -0
- data/lib/vagrant/config/vm/sub_vm.rb +17 -0
- data/lib/vagrant/data_store.rb +70 -0
- data/lib/vagrant/downloaders.rb +7 -0
- data/lib/vagrant/downloaders/base.rb +23 -0
- data/lib/vagrant/downloaders/file.rb +22 -0
- data/lib/vagrant/downloaders/http.rb +64 -0
- data/lib/vagrant/environment.rb +392 -0
- data/lib/vagrant/errors.rb +332 -0
- data/lib/vagrant/hosts.rb +8 -0
- data/lib/vagrant/hosts/arch.rb +27 -0
- data/lib/vagrant/hosts/base.rb +78 -0
- data/lib/vagrant/hosts/bsd.rb +52 -0
- data/lib/vagrant/hosts/linux.rb +47 -0
- data/lib/vagrant/plugin.rb +57 -0
- data/lib/vagrant/provisioners.rb +9 -0
- data/lib/vagrant/provisioners/base.rb +63 -0
- data/lib/vagrant/provisioners/chef.rb +130 -0
- data/lib/vagrant/provisioners/chef_server.rb +103 -0
- data/lib/vagrant/provisioners/chef_solo.rb +142 -0
- data/lib/vagrant/provisioners/puppet.rb +137 -0
- data/lib/vagrant/provisioners/puppet_server.rb +55 -0
- data/lib/vagrant/provisioners/shell.rb +52 -0
- data/lib/vagrant/ssh.rb +173 -0
- data/lib/vagrant/ssh/session.rb +125 -0
- data/lib/vagrant/systems.rb +11 -0
- data/lib/vagrant/systems/base.rb +87 -0
- data/lib/vagrant/systems/debian.rb +36 -0
- data/lib/vagrant/systems/freebsd.rb +84 -0
- data/lib/vagrant/systems/gentoo.rb +27 -0
- data/lib/vagrant/systems/linux.rb +83 -0
- data/lib/vagrant/systems/linux/config.rb +21 -0
- data/lib/vagrant/systems/linux/error.rb +9 -0
- data/lib/vagrant/systems/redhat.rb +39 -0
- data/lib/vagrant/systems/solaris.rb +62 -0
- data/lib/vagrant/systems/ubuntu.rb +17 -0
- data/lib/vagrant/test_helpers.rb +128 -0
- data/lib/vagrant/ui.rb +69 -0
- data/lib/vagrant/util.rb +13 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/plain_logger.rb +25 -0
- data/lib/vagrant/util/platform.rb +65 -0
- data/lib/vagrant/util/resource_logger.rb +63 -0
- data/lib/vagrant/util/retryable.rb +25 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
- data/lib/vagrant/util/template_renderer.rb +83 -0
- data/lib/vagrant/version.rb +6 -0
- data/lib/vagrant/vm.rb +177 -0
- data/templates/chef_server_client.erb +18 -0
- data/templates/chef_solo_solo.erb +19 -0
- data/templates/commands/init/Vagrantfile.erb +82 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/locales/en.yml +535 -0
- data/templates/network_entry_debian.erb +8 -0
- data/templates/network_entry_gentoo.erb +5 -0
- data/templates/network_entry_redhat.erb +8 -0
- data/templates/nfs/exports.erb +5 -0
- data/templates/nfs/exports_linux.erb +5 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/ssh_config.erb +9 -0
- data/test/locales/en.yml +8 -0
- data/test/test_helper.rb +26 -0
- data/test/vagrant/action/box/destroy_test.rb +18 -0
- data/test/vagrant/action/box/download_test.rb +125 -0
- data/test/vagrant/action/box/package_test.rb +25 -0
- data/test/vagrant/action/box/unpackage_test.rb +84 -0
- data/test/vagrant/action/box/verify_test.rb +30 -0
- data/test/vagrant/action/builder_test.rb +203 -0
- data/test/vagrant/action/env/set_test.rb +24 -0
- data/test/vagrant/action/environment_test.rb +27 -0
- data/test/vagrant/action/general/package_test.rb +268 -0
- data/test/vagrant/action/general/validate_test.rb +31 -0
- data/test/vagrant/action/vm/boot_test.rb +66 -0
- data/test/vagrant/action/vm/check_box_test.rb +56 -0
- data/test/vagrant/action/vm/check_guest_additions_test.rb +9 -0
- data/test/vagrant/action/vm/clean_machine_folder_test.rb +84 -0
- data/test/vagrant/action/vm/clear_forwarded_ports_test.rb +72 -0
- data/test/vagrant/action/vm/clear_nfs_exports_test.rb +22 -0
- data/test/vagrant/action/vm/clear_shared_folders_test.rb +49 -0
- data/test/vagrant/action/vm/customize_test.rb +30 -0
- data/test/vagrant/action/vm/destroy_test.rb +25 -0
- data/test/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +49 -0
- data/test/vagrant/action/vm/discard_state_test.rb +45 -0
- data/test/vagrant/action/vm/export_test.rb +107 -0
- data/test/vagrant/action/vm/forward_ports_helpers_test.rb +70 -0
- data/test/vagrant/action/vm/forward_ports_test.rb +194 -0
- data/test/vagrant/action/vm/halt_test.rb +79 -0
- data/test/vagrant/action/vm/host_name_test.rb +36 -0
- data/test/vagrant/action/vm/import_test.rb +66 -0
- data/test/vagrant/action/vm/match_mac_address_test.rb +36 -0
- data/test/vagrant/action/vm/network_test.rb +286 -0
- data/test/vagrant/action/vm/nfs_helpers_test.rb +26 -0
- data/test/vagrant/action/vm/nfs_test.rb +260 -0
- data/test/vagrant/action/vm/package_test.rb +25 -0
- data/test/vagrant/action/vm/package_vagrantfile_test.rb +46 -0
- data/test/vagrant/action/vm/provision_test.rb +90 -0
- data/test/vagrant/action/vm/resume_test.rb +35 -0
- data/test/vagrant/action/vm/share_folders_test.rb +139 -0
- data/test/vagrant/action/vm/suspend_test.rb +35 -0
- data/test/vagrant/action/warden_test.rb +119 -0
- data/test/vagrant/action_test.rb +89 -0
- data/test/vagrant/box_collection_test.rb +45 -0
- data/test/vagrant/box_test.rb +74 -0
- data/test/vagrant/cli_test.rb +35 -0
- data/test/vagrant/command/base_test.rb +23 -0
- data/test/vagrant/command/group_base_test.rb +15 -0
- data/test/vagrant/command/helpers_test.rb +88 -0
- data/test/vagrant/command/package_test.rb +27 -0
- data/test/vagrant/config/base_test.rb +52 -0
- data/test/vagrant/config/error_recorder_test.rb +18 -0
- data/test/vagrant/config/ssh_test.rb +12 -0
- data/test/vagrant/config/vagrant_test.rb +35 -0
- data/test/vagrant/config/vm/provisioner_test.rb +92 -0
- data/test/vagrant/config/vm_test.rb +86 -0
- data/test/vagrant/config_test.rb +162 -0
- data/test/vagrant/data_store_test.rb +77 -0
- data/test/vagrant/downloaders/base_test.rb +28 -0
- data/test/vagrant/downloaders/file_test.rb +48 -0
- data/test/vagrant/downloaders/http_test.rb +80 -0
- data/test/vagrant/environment_test.rb +508 -0
- data/test/vagrant/errors_test.rb +42 -0
- data/test/vagrant/hosts/base_test.rb +46 -0
- data/test/vagrant/hosts/bsd_test.rb +53 -0
- data/test/vagrant/hosts/linux_test.rb +54 -0
- data/test/vagrant/plugin_test.rb +9 -0
- data/test/vagrant/provisioners/base_test.rb +63 -0
- data/test/vagrant/provisioners/chef_server_test.rb +188 -0
- data/test/vagrant/provisioners/chef_solo_test.rb +219 -0
- data/test/vagrant/provisioners/chef_test.rb +179 -0
- data/test/vagrant/provisioners/puppet_server_test.rb +68 -0
- data/test/vagrant/provisioners/puppet_test.rb +182 -0
- data/test/vagrant/provisioners/shell_test.rb +68 -0
- data/test/vagrant/ssh/session_test.rb +40 -0
- data/test/vagrant/ssh_test.rb +342 -0
- data/test/vagrant/systems/base_test.rb +18 -0
- data/test/vagrant/systems/linux_test.rb +114 -0
- data/test/vagrant/ui_test.rb +29 -0
- data/test/vagrant/util/busy_test.rb +106 -0
- data/test/vagrant/util/hash_with_indifferent_access_test.rb +39 -0
- data/test/vagrant/util/plain_logger_test.rb +17 -0
- data/test/vagrant/util/platform_test.rb +18 -0
- data/test/vagrant/util/resource_logger_test.rb +78 -0
- data/test/vagrant/util/retryable_test.rb +50 -0
- data/test/vagrant/util/stacked_proc_runner_test.rb +43 -0
- data/test/vagrant/util/template_renderer_test.rb +145 -0
- data/test/vagrant/vm_test.rb +291 -0
- data/vagrant.gemspec +36 -0
- metadata +514 -0
data/config/default.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
Vagrant::Config.run do |config|
|
2
|
+
# default config goes here
|
3
|
+
config.vagrant.dotfile_name = ".vagrant"
|
4
|
+
config.vagrant.host = :detect
|
5
|
+
|
6
|
+
config.ssh.username = "vagrant"
|
7
|
+
config.ssh.host = "127.0.0.1"
|
8
|
+
config.ssh.forwarded_port_key = "ssh"
|
9
|
+
config.ssh.max_tries = 10
|
10
|
+
config.ssh.timeout = 30
|
11
|
+
config.ssh.private_key_path = File.expand_path("keys/vagrant", Vagrant.source_root)
|
12
|
+
config.ssh.forward_agent = false
|
13
|
+
config.ssh.forward_x11 = false
|
14
|
+
|
15
|
+
config.vm.auto_port_range = (2200..2250)
|
16
|
+
config.vm.box_ovf = "box.ovf"
|
17
|
+
config.vm.box_url = nil
|
18
|
+
config.vm.base_mac = nil
|
19
|
+
config.vm.forward_port("ssh", 22, 2222, :auto => true)
|
20
|
+
config.vm.disk_image_format = 'VMDK'
|
21
|
+
config.vm.shared_folder_uid = nil
|
22
|
+
config.vm.shared_folder_gid = nil
|
23
|
+
config.vm.boot_mode = "vrdp"
|
24
|
+
config.vm.system = :linux
|
25
|
+
|
26
|
+
config.vm.customize do |vm|
|
27
|
+
# Make VM name the name of the containing folder by default
|
28
|
+
vm.name = File.basename(config.env.cwd) + "_#{Time.now.to_i}"
|
29
|
+
end
|
30
|
+
|
31
|
+
# Share the root folder. This can then be overridden by
|
32
|
+
# other Vagrantfiles, if they wish.
|
33
|
+
config.vm.share_folder("v-root", "/vagrant", ".")
|
34
|
+
|
35
|
+
config.nfs.map_uid = :auto
|
36
|
+
config.nfs.map_gid = :auto
|
37
|
+
|
38
|
+
config.package.name = 'package.box'
|
39
|
+
end
|
data/contrib/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Vagrant Contrib
|
2
|
+
|
3
|
+
Miscellaneous contributions which assist people in using Vagrant will
|
4
|
+
make their way into this directory. An up-to-date list of short descriptions
|
5
|
+
for each item will be kept below.
|
6
|
+
|
7
|
+
## List of Contrib Items
|
8
|
+
|
9
|
+
* `emacs` - Contains a file showing how to associate `Vagrantfile` with
|
10
|
+
Ruby syntax highlighting.
|
11
|
+
* `vim` - Contains a `.vim` file for enabling Ruby syntax highlighting
|
12
|
+
for `Vagrantfile`s.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
;;--------------------------------------------------------------------
|
2
|
+
;; Teach emacs to syntax highlight Vagrantfile as Ruby.
|
3
|
+
;;
|
4
|
+
;; Installation: Copy the line below into your emacs configuration,
|
5
|
+
;; or drop this file anywhere in your "~/.emacs.d" directory and be
|
6
|
+
;; sure to "load" it.
|
7
|
+
;;--------------------------------------------------------------------
|
8
|
+
(add-to-list 'auto-mode-alist '("Vagrantfile$" . ruby-mode))
|
data/keys/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Insecure Keypair
|
2
|
+
|
3
|
+
These keys are the "insecure" public/private keypair we offer to
|
4
|
+
[base box creators](http://vagrantup.com/docs/base_boxes.html) for use in their base boxes so that
|
5
|
+
vagrant installations can automatically SSH into the boxes.
|
6
|
+
|
7
|
+
If you're working with a team or company or with a custom box and
|
8
|
+
you want more secure SSH, you should create your own keypair
|
9
|
+
and configure the private key in the Vagrantfile with
|
10
|
+
`config.ssh.private_key_path`
|
11
|
+
|
12
|
+
# Putty
|
13
|
+
|
14
|
+
If you are using Vagrant on windows, the .ppk file contained here, in the keys directory,
|
15
|
+
has been generated from the private key and should be used to connect Putty to any VMs that
|
16
|
+
are leveraging the default key pair. See [guide](http://vagrantup.com/docs/getting-started/windows.html)
|
17
|
+
in the documentation for more details on using Putty with Vagrant.
|
data/keys/vagrant
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEogIB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HuvUhnPLdX
|
17
|
+
3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG
|
18
|
+
YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj
|
19
|
+
3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+
|
20
|
+
dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz
|
21
|
+
6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC
|
22
|
+
P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF
|
23
|
+
llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ
|
24
|
+
kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
|
25
|
+
+vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
|
26
|
+
NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/keys/vagrant.ppk
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
PuTTY-User-Key-File-2: ssh-rsa
|
2
|
+
Encryption: none
|
3
|
+
Comment: imported-openssh-key
|
4
|
+
Public-Lines: 6
|
5
|
+
AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+k
|
6
|
+
z4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdO
|
7
|
+
KLv6IedplqoPkcmF0aYet2PkEDo3M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7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH+vq/
|
24
|
+
5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQNE5O
|
25
|
+
gEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
|
26
|
+
Private-MAC: bc710f345e67c736d57dd72aab10fe4625345dae
|
data/keys/vagrant.pub
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
data/lib/vagrant.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'json'
|
3
|
+
require 'i18n'
|
4
|
+
require 'virtualbox'
|
5
|
+
|
6
|
+
module Vagrant
|
7
|
+
autoload :Action, 'vagrant/action'
|
8
|
+
autoload :Box, 'vagrant/box'
|
9
|
+
autoload :BoxCollection, 'vagrant/box_collection'
|
10
|
+
autoload :CLI, 'vagrant/cli'
|
11
|
+
autoload :Config, 'vagrant/config'
|
12
|
+
autoload :DataStore, 'vagrant/data_store'
|
13
|
+
autoload :Downloaders, 'vagrant/downloaders'
|
14
|
+
autoload :Environment, 'vagrant/environment'
|
15
|
+
autoload :Errors, 'vagrant/errors'
|
16
|
+
autoload :Hosts, 'vagrant/hosts'
|
17
|
+
autoload :Plugin, 'vagrant/plugin'
|
18
|
+
autoload :TestHelpers, 'vagrant/test_helpers'
|
19
|
+
autoload :UI, 'vagrant/ui'
|
20
|
+
autoload :Util, 'vagrant/util'
|
21
|
+
autoload :VM, 'vagrant/vm'
|
22
|
+
|
23
|
+
# The source root is the path to the root directory of
|
24
|
+
# the Vagrant gem.
|
25
|
+
def self.source_root
|
26
|
+
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Default I18n to load the en locale
|
31
|
+
I18n.load_path << File.expand_path("templates/locales/en.yml", Vagrant.source_root)
|
32
|
+
|
33
|
+
# Load the things which must be loaded before anything else. Note that
|
34
|
+
# I'm not sure why 'vagrant/ssh' must be loaded. But if I don't, I get
|
35
|
+
# a very scary "unsupported cipher" error from net-ssh for no apparent reason.
|
36
|
+
require 'vagrant/command'
|
37
|
+
require 'vagrant/provisioners'
|
38
|
+
require 'vagrant/systems'
|
39
|
+
require 'vagrant/ssh'
|
40
|
+
require 'vagrant/version'
|
41
|
+
Vagrant::Action.builtin!
|
42
|
+
Vagrant::Plugin.load!
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'vagrant/action/builder'
|
2
|
+
require 'vagrant/action/builtin'
|
3
|
+
|
4
|
+
# The builtin middlewares
|
5
|
+
require 'vagrant/action/box'
|
6
|
+
require 'vagrant/action/env'
|
7
|
+
require 'vagrant/action/general'
|
8
|
+
require 'vagrant/action/vm'
|
9
|
+
|
10
|
+
module Vagrant
|
11
|
+
# Manages action running and registration. Every Vagrant environment
|
12
|
+
# has an instance of {Action} to allow for running in the context of
|
13
|
+
# the environment, which is accessible at {Environment#actions}. Actions
|
14
|
+
# are the foundation of most functionality in Vagrant, and are implemented
|
15
|
+
# architecturally as "middleware."
|
16
|
+
#
|
17
|
+
# # Registering an Action
|
18
|
+
#
|
19
|
+
# The main benefits of registering an action is the ability to retrieve and
|
20
|
+
# modify that registered action, as well as easily run the action. An example
|
21
|
+
# of registering an action is shown below, with a simple middleware which just
|
22
|
+
# outputs to `STDOUT`:
|
23
|
+
#
|
24
|
+
# class StdoutMiddleware
|
25
|
+
# def initialize(app, env)
|
26
|
+
# @app = app
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# def call(env)
|
30
|
+
# puts "HI!"
|
31
|
+
# @app.call(env)
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
# Vagrant::Action.register(:stdout, StdoutMiddleware)
|
36
|
+
#
|
37
|
+
# Then to run a registered action, assuming `env` is a loaded {Environment}:
|
38
|
+
#
|
39
|
+
# env.actions.run(:stdout)
|
40
|
+
#
|
41
|
+
# Or to retrieve the action class for any reason:
|
42
|
+
#
|
43
|
+
# Vagrant::Action[:stdout]
|
44
|
+
#
|
45
|
+
# # Running an Action
|
46
|
+
#
|
47
|
+
# There are various built-in registered actions such as `start`, `stop`, `up`,
|
48
|
+
# etc. Actions are built to be run in the context of an environment, so use
|
49
|
+
# {Environment#actions} to run all actions. Then simply call {#run}:
|
50
|
+
#
|
51
|
+
# env.actions.run(:name)
|
52
|
+
#
|
53
|
+
# Where `:name` is the name of the registered action.
|
54
|
+
#
|
55
|
+
class Action
|
56
|
+
autoload :Environment, 'vagrant/action/environment'
|
57
|
+
autoload :Warden, 'vagrant/action/warden'
|
58
|
+
|
59
|
+
include Util
|
60
|
+
@@reported_interrupt = false
|
61
|
+
|
62
|
+
class << self
|
63
|
+
# Returns the list of registered actions.
|
64
|
+
#
|
65
|
+
# @return [Array]
|
66
|
+
def actions
|
67
|
+
@actions ||= {}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Registers an action and associates it with a symbol. This
|
71
|
+
# symbol can then be referenced in other action builds and
|
72
|
+
# callbacks can be registered on that symbol.
|
73
|
+
#
|
74
|
+
# @param [Symbol] key
|
75
|
+
def register(key, callable)
|
76
|
+
actions[key.to_sym] = callable
|
77
|
+
end
|
78
|
+
|
79
|
+
# Retrieves a registered action by key.
|
80
|
+
#
|
81
|
+
# @param [Symbol] key
|
82
|
+
def [](key)
|
83
|
+
actions[key.to_sym]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# The environment to run the actions in.
|
88
|
+
attr_reader :env
|
89
|
+
|
90
|
+
# Initializes the action with the given environment which the actions
|
91
|
+
# will be run in.
|
92
|
+
#
|
93
|
+
# @param [Environment] env
|
94
|
+
def initialize(env)
|
95
|
+
@env = env
|
96
|
+
end
|
97
|
+
|
98
|
+
# Runs the given callable object in the context of the environment.
|
99
|
+
# If a symbol is given as the `callable` parameter, then it is looked
|
100
|
+
# up in the registered actions list which are registered with {register}.
|
101
|
+
#
|
102
|
+
# Any options given are injected into the environment hash.
|
103
|
+
#
|
104
|
+
# @param [Object] callable An object which responds to `call`.
|
105
|
+
def run(callable_id, options=nil)
|
106
|
+
callable = callable_id
|
107
|
+
callable = Builder.new.use(callable_id) if callable_id.kind_of?(Class)
|
108
|
+
callable = self.class.actions[callable_id] if callable_id.kind_of?(Symbol)
|
109
|
+
raise ArgumentError, "Argument to run must be a callable object or registered action." if !callable || !callable.respond_to?(:call)
|
110
|
+
|
111
|
+
action_environment = Action::Environment.new(env)
|
112
|
+
action_environment.merge!(options || {})
|
113
|
+
|
114
|
+
# Run the before action run callback, if we're not doing that already
|
115
|
+
run(:before_action_run, action_environment) if callable_id != :before_action_run
|
116
|
+
|
117
|
+
# Run the action chain in a busy block, marking the environment as
|
118
|
+
# interrupted if a SIGINT occurs, and exiting cleanly once the
|
119
|
+
# chain has been run.
|
120
|
+
int_callback = lambda do
|
121
|
+
if action_environment.interrupted?
|
122
|
+
env.ui.error I18n.t("vagrant.actions.runner.exit_immediately")
|
123
|
+
abort
|
124
|
+
end
|
125
|
+
|
126
|
+
env.ui.warn I18n.t("vagrant.actions.runner.waiting_cleanup") if !@@reported_interrupt
|
127
|
+
action_environment.interrupt!
|
128
|
+
@@reported_interrupt = true
|
129
|
+
end
|
130
|
+
|
131
|
+
Busy.busy(int_callback) { callable.call(action_environment) }
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Vagrant
|
2
|
+
class Action
|
3
|
+
module Box
|
4
|
+
autoload :Destroy, 'vagrant/action/box/destroy'
|
5
|
+
autoload :Download, 'vagrant/action/box/download'
|
6
|
+
autoload :Package, 'vagrant/action/box/package'
|
7
|
+
autoload :Unpackage, 'vagrant/action/box/unpackage'
|
8
|
+
autoload :Verify, 'vagrant/action/box/verify'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
class Action
|
5
|
+
module Box
|
6
|
+
class Destroy
|
7
|
+
def initialize(app, env)
|
8
|
+
@app = app
|
9
|
+
@env = env
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
env.ui.info I18n.t("vagrant.actions.box.destroy.destroying", :name => env["box"].name)
|
14
|
+
FileUtils.rm_rf(env["box"].directory)
|
15
|
+
|
16
|
+
@app.call(env)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Vagrant
|
2
|
+
class Action
|
3
|
+
module Box
|
4
|
+
class Download
|
5
|
+
BASENAME = "box"
|
6
|
+
|
7
|
+
include Util
|
8
|
+
|
9
|
+
attr_reader :temp_path
|
10
|
+
|
11
|
+
def initialize(app, env)
|
12
|
+
@app = app
|
13
|
+
@env = env
|
14
|
+
@env["download.classes"] ||= []
|
15
|
+
@env["download.classes"] += [Downloaders::HTTP, Downloaders::File]
|
16
|
+
@downloader = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def call(env)
|
20
|
+
@env = env
|
21
|
+
|
22
|
+
download if instantiate_downloader
|
23
|
+
@app.call(@env)
|
24
|
+
|
25
|
+
recover(env) # called in both cases to cleanup workspace
|
26
|
+
end
|
27
|
+
|
28
|
+
def instantiate_downloader
|
29
|
+
@env["download.classes"].each do |klass|
|
30
|
+
if klass.match?(@env["box"].uri)
|
31
|
+
@env.ui.info I18n.t("vagrant.actions.box.download.with", :class => klass.to_s)
|
32
|
+
@downloader = klass.new(@env)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
raise Errors::BoxDownloadUnknownType if !@downloader
|
37
|
+
|
38
|
+
@downloader.prepare(@env["box"].uri)
|
39
|
+
true
|
40
|
+
end
|
41
|
+
|
42
|
+
def download
|
43
|
+
with_tempfile do |tempfile|
|
44
|
+
download_to(tempfile)
|
45
|
+
@temp_path = @env["download.temp_path"] = tempfile.path
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def recover(env)
|
50
|
+
if temp_path && File.exist?(temp_path)
|
51
|
+
env.ui.info I18n.t("vagrant.actions.box.download.cleaning")
|
52
|
+
File.unlink(temp_path)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def with_tempfile
|
57
|
+
File.open(box_temp_path, Platform.tar_file_options) do |tempfile|
|
58
|
+
yield tempfile
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def box_temp_path
|
63
|
+
@env.env.tmp_path.join(BASENAME + Time.now.to_i.to_s)
|
64
|
+
end
|
65
|
+
|
66
|
+
def download_to(f)
|
67
|
+
@downloader.download!(@env["box"].uri, f)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'vagrant/action/general/package'
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
class Action
|
5
|
+
module Box
|
6
|
+
# Packages a box which has already been unpackaged (such as
|
7
|
+
# for the `vagrant box repackage` command) by leveraging the
|
8
|
+
# general packager middleware.
|
9
|
+
class Package < General::Package
|
10
|
+
# Alias instead of calling super for testability
|
11
|
+
alias_method :general_call, :call
|
12
|
+
def call(env)
|
13
|
+
env["package.directory"] = env["box"].directory
|
14
|
+
general_call(env)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|