rvagrant 0.8.7.dev
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +25 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +386 -0
- data/Gemfile +21 -0
- data/LICENSE +21 -0
- data/README.md +61 -0
- data/Rakefile +11 -0
- data/bin/vagrant +28 -0
- data/config/default.rb +38 -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 +44 -0
- data/lib/vagrant/action.rb +138 -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 +108 -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 +113 -0
- data/lib/vagrant/action/general/validate.rb +19 -0
- data/lib/vagrant/action/vm.rb +34 -0
- data/lib/vagrant/action/vm/boot.rb +48 -0
- data/lib/vagrant/action/vm/check_accessible.rb +23 -0
- data/lib/vagrant/action/vm/check_box.rb +28 -0
- data/lib/vagrant/action/vm/check_guest_additions.rb +35 -0
- data/lib/vagrant/action/vm/clean_machine_folder.rb +43 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +26 -0
- data/lib/vagrant/action/vm/clear_nfs_exports.rb +20 -0
- data/lib/vagrant/action/vm/clear_shared_folders.rb +27 -0
- data/lib/vagrant/action/vm/customize.rb +26 -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 +133 -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 +40 -0
- data/lib/vagrant/action/vm/match_mac_address.rb +26 -0
- data/lib/vagrant/action/vm/modify.rb +37 -0
- data/lib/vagrant/action/vm/network.rb +146 -0
- data/lib/vagrant/action/vm/nfs.rb +160 -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 +34 -0
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
- data/lib/vagrant/action/vm/resume.rb +20 -0
- data/lib/vagrant/action/vm/share_folders.rb +78 -0
- data/lib/vagrant/action/vm/suspend.rb +20 -0
- data/lib/vagrant/action/warden.rb +85 -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 +23 -0
- data/lib/vagrant/command/reload.rb +17 -0
- data/lib/vagrant/command/resume.rb +17 -0
- data/lib/vagrant/command/ssh.rb +49 -0
- data/lib/vagrant/command/ssh_config.rb +29 -0
- data/lib/vagrant/command/status.rb +31 -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 +38 -0
- data/lib/vagrant/config/top.rb +61 -0
- data/lib/vagrant/config/vagrant.rb +17 -0
- data/lib/vagrant/config/vm.rb +148 -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 +70 -0
- data/lib/vagrant/environment.rb +516 -0
- data/lib/vagrant/errors.rb +352 -0
- data/lib/vagrant/hosts.rb +9 -0
- data/lib/vagrant/hosts/arch.rb +27 -0
- data/lib/vagrant/hosts/base.rb +76 -0
- data/lib/vagrant/hosts/bsd.rb +58 -0
- data/lib/vagrant/hosts/fedora.rb +11 -0
- data/lib/vagrant/hosts/linux.rb +69 -0
- data/lib/vagrant/plugin.rb +79 -0
- data/lib/vagrant/provisioners.rb +9 -0
- data/lib/vagrant/provisioners/base.rb +67 -0
- data/lib/vagrant/provisioners/chef.rb +155 -0
- data/lib/vagrant/provisioners/chef_client.rb +120 -0
- data/lib/vagrant/provisioners/chef_solo.rb +135 -0
- data/lib/vagrant/provisioners/puppet.rb +137 -0
- data/lib/vagrant/provisioners/puppet_server.rb +55 -0
- data/lib/vagrant/provisioners/shell.rb +96 -0
- data/lib/vagrant/ssh.rb +224 -0
- data/lib/vagrant/ssh/session.rb +136 -0
- data/lib/vagrant/systems.rb +13 -0
- data/lib/vagrant/systems/arch.rb +34 -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 +82 -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 +48 -0
- data/lib/vagrant/systems/solaris.rb +67 -0
- data/lib/vagrant/systems/suse.rb +9 -0
- data/lib/vagrant/systems/ubuntu.rb +17 -0
- data/lib/vagrant/test_helpers.rb +128 -0
- data/lib/vagrant/ui.rb +81 -0
- data/lib/vagrant/util.rb +13 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/counter.rb +24 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/platform.rb +57 -0
- data/lib/vagrant/util/retryable.rb +25 -0
- data/lib/vagrant/util/safe_exec.rb +35 -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 +181 -0
- data/templates/chef_server_client.erb +32 -0
- data/templates/chef_solo_solo.erb +23 -0
- data/templates/commands/init/Vagrantfile.erb +86 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/locales/en.yml +556 -0
- data/templates/network_entry_arch.erb +9 -0
- data/templates/network_entry_debian.erb +8 -0
- data/templates/network_entry_gentoo.erb +5 -0
- data/templates/network_entry_redhat.erb +9 -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 +15 -0
- data/test/unit/locales/en.yml +8 -0
- data/test/unit/test_helper.rb +28 -0
- data/test/unit/vagrant/action/box/destroy_test.rb +18 -0
- data/test/unit/vagrant/action/box/download_test.rb +125 -0
- data/test/unit/vagrant/action/box/package_test.rb +25 -0
- data/test/unit/vagrant/action/box/unpackage_test.rb +84 -0
- data/test/unit/vagrant/action/box/verify_test.rb +30 -0
- data/test/unit/vagrant/action/builder_test.rb +207 -0
- data/test/unit/vagrant/action/env/set_test.rb +24 -0
- data/test/unit/vagrant/action/environment_test.rb +27 -0
- data/test/unit/vagrant/action/general/package_test.rb +268 -0
- data/test/unit/vagrant/action/general/validate_test.rb +31 -0
- data/test/unit/vagrant/action/vm/boot_test.rb +66 -0
- data/test/unit/vagrant/action/vm/check_accessible_test.rb +61 -0
- data/test/unit/vagrant/action/vm/check_box_test.rb +56 -0
- data/test/unit/vagrant/action/vm/check_guest_additions_test.rb +9 -0
- data/test/unit/vagrant/action/vm/clean_machine_folder_test.rb +84 -0
- data/test/unit/vagrant/action/vm/clear_forwarded_ports_test.rb +52 -0
- data/test/unit/vagrant/action/vm/clear_nfs_exports_test.rb +22 -0
- data/test/unit/vagrant/action/vm/clear_shared_folders_test.rb +40 -0
- data/test/unit/vagrant/action/vm/customize_test.rb +37 -0
- data/test/unit/vagrant/action/vm/destroy_test.rb +25 -0
- data/test/unit/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +49 -0
- data/test/unit/vagrant/action/vm/discard_state_test.rb +45 -0
- data/test/unit/vagrant/action/vm/export_test.rb +107 -0
- data/test/unit/vagrant/action/vm/forward_ports_helpers_test.rb +77 -0
- data/test/unit/vagrant/action/vm/forward_ports_test.rb +213 -0
- data/test/unit/vagrant/action/vm/halt_test.rb +79 -0
- data/test/unit/vagrant/action/vm/host_name_test.rb +36 -0
- data/test/unit/vagrant/action/vm/import_test.rb +66 -0
- data/test/unit/vagrant/action/vm/match_mac_address_test.rb +40 -0
- data/test/unit/vagrant/action/vm/modify_test.rb +38 -0
- data/test/unit/vagrant/action/vm/network_test.rb +286 -0
- data/test/unit/vagrant/action/vm/nfs_helpers_test.rb +26 -0
- data/test/unit/vagrant/action/vm/nfs_test.rb +260 -0
- data/test/unit/vagrant/action/vm/package_test.rb +25 -0
- data/test/unit/vagrant/action/vm/package_vagrantfile_test.rb +46 -0
- data/test/unit/vagrant/action/vm/provision_test.rb +65 -0
- data/test/unit/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
- data/test/unit/vagrant/action/vm/resume_test.rb +35 -0
- data/test/unit/vagrant/action/vm/share_folders_test.rb +144 -0
- data/test/unit/vagrant/action/vm/suspend_test.rb +35 -0
- data/test/unit/vagrant/action/warden_test.rb +125 -0
- data/test/unit/vagrant/action_test.rb +89 -0
- data/test/unit/vagrant/box_collection_test.rb +45 -0
- data/test/unit/vagrant/box_test.rb +74 -0
- data/test/unit/vagrant/cli_test.rb +35 -0
- data/test/unit/vagrant/command/base_test.rb +23 -0
- data/test/unit/vagrant/command/group_base_test.rb +15 -0
- data/test/unit/vagrant/command/helpers_test.rb +88 -0
- data/test/unit/vagrant/command/package_test.rb +27 -0
- data/test/unit/vagrant/config/base_test.rb +52 -0
- data/test/unit/vagrant/config/error_recorder_test.rb +18 -0
- data/test/unit/vagrant/config/ssh_test.rb +12 -0
- data/test/unit/vagrant/config/vagrant_test.rb +35 -0
- data/test/unit/vagrant/config/vm/provisioner_test.rb +92 -0
- data/test/unit/vagrant/config/vm_test.rb +56 -0
- data/test/unit/vagrant/config_test.rb +162 -0
- data/test/unit/vagrant/data_store_test.rb +77 -0
- data/test/unit/vagrant/downloaders/base_test.rb +28 -0
- data/test/unit/vagrant/downloaders/file_test.rb +48 -0
- data/test/unit/vagrant/downloaders/http_test.rb +82 -0
- data/test/unit/vagrant/environment_test.rb +598 -0
- data/test/unit/vagrant/errors_test.rb +42 -0
- data/test/unit/vagrant/hosts/base_test.rb +46 -0
- data/test/unit/vagrant/hosts/bsd_test.rb +53 -0
- data/test/unit/vagrant/hosts/linux_test.rb +54 -0
- data/test/unit/vagrant/plugin_test.rb +9 -0
- data/test/unit/vagrant/provisioners/base_test.rb +63 -0
- data/test/unit/vagrant/provisioners/chef_client_test.rb +190 -0
- data/test/unit/vagrant/provisioners/chef_solo_test.rb +114 -0
- data/test/unit/vagrant/provisioners/chef_test.rb +202 -0
- data/test/unit/vagrant/provisioners/puppet_server_test.rb +68 -0
- data/test/unit/vagrant/provisioners/puppet_test.rb +182 -0
- data/test/unit/vagrant/provisioners/shell_test.rb +79 -0
- data/test/unit/vagrant/ssh/session_test.rb +40 -0
- data/test/unit/vagrant/ssh_test.rb +307 -0
- data/test/unit/vagrant/systems/base_test.rb +18 -0
- data/test/unit/vagrant/systems/linux_test.rb +104 -0
- data/test/unit/vagrant/ui_test.rb +29 -0
- data/test/unit/vagrant/util/busy_test.rb +106 -0
- data/test/unit/vagrant/util/counter_test.rb +29 -0
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +39 -0
- data/test/unit/vagrant/util/platform_test.rb +18 -0
- data/test/unit/vagrant/util/retryable_test.rb +50 -0
- data/test/unit/vagrant/util/stacked_proc_runner_test.rb +43 -0
- data/test/unit/vagrant/util/template_renderer_test.rb +145 -0
- data/test/unit/vagrant/vm_test.rb +300 -0
- data/vagrant.gemspec +35 -0
- metadata +431 -0
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Vagrant
|
2
|
+
|
3
|
+
* Website: [http://vagrantup.com](http://vagrantup.com)
|
4
|
+
* Source: [http://github.com/mitchellh/vagrant](http://github.com/mitchellh/vagrant)
|
5
|
+
* IRC: `#vagrant` on Freenode
|
6
|
+
* Mailing list: [Google Groups](http://groups.google.com/group/vagrant-up)
|
7
|
+
|
8
|
+
Vagrant is a tool for building and distributing virtualized development environments.
|
9
|
+
|
10
|
+
By providing automated creation and provisioning of virtual machines using [Oracle’s VirtualBox](http://www.virtualbox.org),
|
11
|
+
Vagrant provides the tools to create and configure lightweight, reproducible, and portable
|
12
|
+
virtual environments. For more information, see the part of the getting started guide
|
13
|
+
on “[Why Vagrant?](http://vagrantup.com/docs/getting-started/index.html)”
|
14
|
+
|
15
|
+
## Quick Start
|
16
|
+
|
17
|
+
First, make sure your development machine has [VirtualBox](http://www.virtualbox.org)
|
18
|
+
installed. The setup from that point forward is very easy, since Vagrant is simply
|
19
|
+
a rubygem.
|
20
|
+
|
21
|
+
gem install vagrant
|
22
|
+
|
23
|
+
To build your first virtual environment:
|
24
|
+
|
25
|
+
vagrant init lucid32 http://files.vagrantup.com/lucid32.box
|
26
|
+
vagrant up
|
27
|
+
|
28
|
+
Note: The above `vagrant up` command will also trigger Vagrant to download the
|
29
|
+
`lucid32` box via the specified URL. Vagrant only does this if it detects that
|
30
|
+
the box doesn't already exist on your system.
|
31
|
+
|
32
|
+
## Getting Started Guide and Video
|
33
|
+
|
34
|
+
To learn how to build a fully functional rails development environment, view the
|
35
|
+
[getting started guide](http://vagrantup.com/docs/getting-started/index.html).
|
36
|
+
|
37
|
+
There is also a fairly short (12 minute) [getting started video](http://vimeo.com/9976342) which
|
38
|
+
explains how to build a fully functional LAMP development environment, which
|
39
|
+
covers a few parts of Vagrant in more detail than the website guide.
|
40
|
+
|
41
|
+
## Installing the Gem from Git
|
42
|
+
|
43
|
+
If you want the bleeding edge version of Vagrant, we try to keep master pretty stable
|
44
|
+
and you're welcome to give it a shot. The following is an example showing how to do this:
|
45
|
+
|
46
|
+
rake install
|
47
|
+
|
48
|
+
## Contributing to Vagrant
|
49
|
+
|
50
|
+
To hack on vagrant, you'll need [bundler](http://github.com/carlhuda/bundler) which can
|
51
|
+
be installed with a simple `gem install bundler --pre`. Afterwords, do the following:
|
52
|
+
|
53
|
+
bundle install
|
54
|
+
rake
|
55
|
+
|
56
|
+
This will run the test suite, which should come back all green! Then you're good to go!
|
57
|
+
|
58
|
+
If you want to run Vagrant without having to install the gem, you may use `bundle exec`,
|
59
|
+
like so:
|
60
|
+
|
61
|
+
bundle exec bin/vagrant help
|
data/Rakefile
ADDED
data/bin/vagrant
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'vagrant'
|
3
|
+
require 'vagrant/cli'
|
4
|
+
|
5
|
+
env = Vagrant::Environment.new
|
6
|
+
|
7
|
+
begin
|
8
|
+
# Begin logging early here
|
9
|
+
env.logger.info("vagrant") { "`vagrant` invoked: #{ARGV.inspect}" }
|
10
|
+
|
11
|
+
# Disable color if the proper argument was passed
|
12
|
+
shell = ARGV.include?("--no-color") ? Thor::Shell::Basic.new : Thor::Base.shell.new
|
13
|
+
|
14
|
+
# Set the UI early in case any errors are raised, and load
|
15
|
+
# the config immediately, so we gather any new commands from
|
16
|
+
# plugins
|
17
|
+
env.ui = Vagrant::UI::Shell.new(env, shell)
|
18
|
+
env.load!
|
19
|
+
|
20
|
+
# Kick start the CLI
|
21
|
+
Vagrant::CLI.start(ARGV, :env => env)
|
22
|
+
rescue Vagrant::Errors::VagrantError => e
|
23
|
+
opts = { :prefix => false }
|
24
|
+
env.ui.error e.message, opts if e.message
|
25
|
+
env.ui.error e.backtrace.join("\n"), opts if ENV["VAGRANT_DEBUG"]
|
26
|
+
exit e.status_code if e.respond_to?(:status_code)
|
27
|
+
exit 999 # An error occurred with no status code defined
|
28
|
+
end
|
data/config/default.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
Vagrant::Config.run do |config|
|
2
|
+
# default config goes here
|
3
|
+
config.vagrant.dotfile_name = ".vagrant"
|
4
|
+
config.vagrant.host = :detect
|
5
|
+
config.vagrant.ssh_session_cache = false
|
6
|
+
|
7
|
+
config.ssh.username = "vagrant"
|
8
|
+
config.ssh.host = "127.0.0.1"
|
9
|
+
config.ssh.forwarded_port_key = "ssh"
|
10
|
+
config.ssh.forwarded_port_destination = 22
|
11
|
+
config.ssh.max_tries = 10
|
12
|
+
config.ssh.timeout = 30
|
13
|
+
config.ssh.private_key_path = File.expand_path("keys/vagrant", Vagrant.source_root)
|
14
|
+
config.ssh.forward_agent = false
|
15
|
+
config.ssh.forward_x11 = false
|
16
|
+
|
17
|
+
config.vm.auto_port_range = (2200..2250)
|
18
|
+
config.vm.box_ovf = "box.ovf"
|
19
|
+
config.vm.box_url = nil
|
20
|
+
config.vm.base_mac = nil
|
21
|
+
config.vm.forward_port("ssh", 22, 2222, :auto => true)
|
22
|
+
config.vm.boot_mode = "vrdp"
|
23
|
+
config.vm.system = :linux
|
24
|
+
|
25
|
+
config.vm.customize do |vm|
|
26
|
+
# Make VM name the name of the containing folder by default
|
27
|
+
vm.name = File.basename(config.env.cwd) + "_#{Time.now.to_i}"
|
28
|
+
end
|
29
|
+
|
30
|
+
# Share the root folder. This can then be overridden by
|
31
|
+
# other Vagrantfiles, if they wish.
|
32
|
+
config.vm.share_folder("v-root", "/vagrant", ".")
|
33
|
+
|
34
|
+
config.nfs.map_uid = :auto
|
35
|
+
config.nfs.map_gid = :auto
|
36
|
+
|
37
|
+
config.package.name = 'package.box'
|
38
|
+
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
|
+
MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
|
3
|
+
w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
|
4
|
+
kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2
|
5
|
+
hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO
|
6
|
+
Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW
|
7
|
+
yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd
|
8
|
+
ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1
|
9
|
+
Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf
|
10
|
+
TK2L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gcJ/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
|
+
KLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4
|
8
|
+
O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGj
|
9
|
+
yiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPK
|
10
|
+
cF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==
|
11
|
+
Private-Lines: 14
|
12
|
+
AAABAQDiKpY8le3NkDryYp0QuziMmx3KTL57B1l412zm2NycdTnNRgTbkr598kQP
|
13
|
+
2pRYgJwtkNzzVMZaMfICoPUHDtemBTAWB5QnBSXNC6sC/7/JKfGLC5oYl+EUzUJp
|
14
|
+
AfN9emGBWaX59lS+clRO/N9MrYuDoR1tQT1NqtSUF//E9+4SExKUgTmR5v9nPf8t
|
15
|
+
SVGDzIOrPnD5BZUni62cqcqKrBk3SbCnBTthLImGVPhhXUXefhiMuzAznAmzaiqb
|
16
|
+
SOyxC78FPS3IRc0NgEsQXgCwKVp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4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
data/lib/vagrant.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'json'
|
3
|
+
require 'i18n'
|
4
|
+
require 'virtualbox'
|
5
|
+
|
6
|
+
# OpenSSL must be loaded here since when it is loaded via `autoload`
|
7
|
+
# there are issues with ciphers not being properly loaded.
|
8
|
+
require 'openssl'
|
9
|
+
|
10
|
+
module Vagrant
|
11
|
+
autoload :Action, 'vagrant/action'
|
12
|
+
autoload :Box, 'vagrant/box'
|
13
|
+
autoload :BoxCollection, 'vagrant/box_collection'
|
14
|
+
autoload :CLI, 'vagrant/cli'
|
15
|
+
autoload :Config, 'vagrant/config'
|
16
|
+
autoload :DataStore, 'vagrant/data_store'
|
17
|
+
autoload :Downloaders, 'vagrant/downloaders'
|
18
|
+
autoload :Environment, 'vagrant/environment'
|
19
|
+
autoload :Errors, 'vagrant/errors'
|
20
|
+
autoload :Hosts, 'vagrant/hosts'
|
21
|
+
autoload :Plugin, 'vagrant/plugin'
|
22
|
+
autoload :SSH, 'vagrant/ssh'
|
23
|
+
autoload :TestHelpers, 'vagrant/test_helpers'
|
24
|
+
autoload :UI, 'vagrant/ui'
|
25
|
+
autoload :Util, 'vagrant/util'
|
26
|
+
autoload :VM, 'vagrant/vm'
|
27
|
+
|
28
|
+
# The source root is the path to the root directory of
|
29
|
+
# the Vagrant gem.
|
30
|
+
def self.source_root
|
31
|
+
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# # Default I18n to load the en locale
|
36
|
+
I18n.load_path << File.expand_path("templates/locales/en.yml", Vagrant.source_root)
|
37
|
+
|
38
|
+
# Load the things which must be loaded before anything else.
|
39
|
+
require 'vagrant/command'
|
40
|
+
require 'vagrant/provisioners'
|
41
|
+
require 'vagrant/systems'
|
42
|
+
require 'vagrant/version'
|
43
|
+
Vagrant::Action.builtin!
|
44
|
+
Vagrant::Plugin.load!
|
@@ -0,0 +1,138 @@
|
|
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
|
+
# We place a process lock around every action that is called
|
132
|
+
env.logger.info "Running action: #{callable_id}"
|
133
|
+
env.lock do
|
134
|
+
Busy.busy(int_callback) { callable.call(action_environment) }
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
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
|