61 Commits

Author SHA1 Message Date
Mitchell Hashimoto
c8053c00a4 New provisioner API. Shell provisioner adheres to it. 2013-01-13 15:48:52 -08:00
Mitchell Hashimoto
25fcb59e38 Use registries for the V2 plugin manager 2013-01-13 13:05:31 -08:00
Mitchell Hashimoto
f3b340aae0 Use registry merging for provider configs 2013-01-13 13:00:06 -08:00
Mitchell Hashimoto
e66c5066e4 Plugin configuration can have scopes now, ex. provider 2013-01-13 12:38:17 -08:00
Mitchell Hashimoto
f428b288f3 Convert provider to symbol only if non-nil 2012-12-30 18:08:07 -10:00
Mitchell Hashimoto
20253c4c4f Convert provider to symbol 2012-12-30 18:04:31 -10:00
Mitchell Hashimoto
4c46091746 Environment#primary_machine_name and use it for with_target_vms
This makes the single-provider and default provider semantics work with
primary VMs.
2012-12-30 11:12:56 -10:00
Mitchell Hashimoto
07157b47ae Only allow one provider active machine at a time.
Temporary limitation of Vagrant to only allow one active machine with a
provider at a time. That means you cant `up` a machine with both vmware
and virtualbox at the same time. In the future you will be able to but
to avoid various edge cases for now we're disallowing it.
2012-12-30 10:52:01 -10:00
Mitchell Hashimoto
526603dbbf Lots more logging in with_target_vms 2012-12-29 18:34:11 -10:00
Mitchell Hashimoto
8fe0f86dbd The --provider flag for up now actually does something. 2012-12-23 21:23:08 -08:00
Mitchell Hashimoto
3808ea377f Upgrade all other default configurations to V2 2012-12-23 16:29:26 -08:00
Mitchell Hashimoto
b0b7c56aa3 More accurate commenting/documentation on the command helpers 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto
ac7958a43b Environment#primary_machine takes a provider argument. Use it. 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
128c06e78d Environment#default_provider 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
1ee470a551 Begin work on supporting provider-specific configuration
This works by registering a `config` with `:provider => true` with the
same name as your provider. Vagrant will then automatically configure
the provider when `config.vm.provider` is used.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
99c5cddb7d V2 config supports the concept of an "UNSET" value when doing merges
This value should be used as a default, and allows the parent `merge`
method to "just work" most of the time.
2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
1559f7b7a7 Get rid of the old Environment#vms calls. Use #machine everywhere. 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
130a602e9b Style nitpick 2012-12-16 10:40:12 -08:00
Nate Smith
d556c0006c Update lib/vagrant/plugin/v2/plugin.rb
Require set in the V2 plugin file since it uses it.

Fixes #1257
2012-12-11 15:51:35 -05:00
Mitchell Hashimoto
d84b71d73e Require set in the V1 plugin file since it uses it. 2012-12-01 11:28:31 -08:00
Mitchell Hashimoto
53860f90ab V2 loader now properly upgrades V1 configuration.
This is done by calling the `upgrade` method on the _old_ configuration
classes. The old configuration classes are given the complete new
configuration and can set whatever settings they need to on it.
2012-11-07 20:01:39 -08:00
Mitchell Hashimoto
d254d6f718 Configure the V2 kernel. 2012-11-06 21:28:44 -08:00
Mitchell Hashimoto
e8370f0098 Convert comands to V2 plugins. 2012-11-06 21:09:29 -08:00
Mitchell Hashimoto
be294e002a Build the v2 interface, which is just a copy of V1 for now. 2012-11-06 20:51:03 -08:00
Mitchell Hashimoto
59d5c5ed92 Add support for "upgrade safe" config classes to plugins.
These are classes that use NO core classes of Vagrant, and are therefore
safe to load for upgrades. i.e. a V2 core can load a V1 config class
that is deemed upgrade safe without crashing Vagrant.
2012-11-03 21:39:06 -07:00
Mitchell Hashimoto
c803b0508a Much cleaner plugin part querying syntax.
Before we were manually going over every plugin and getting each piece,
all over the place. Now we have a central manager that will give us all
the pieces we want. There is still some cleanup to do here but this is
much better overall.
2012-11-03 21:25:28 -07:00
Mitchell Hashimoto
6df6f6764f Remove plugin activation. It really isn't necessary.
It was only used in a couple places and it isn't necessary since you can
do the loading within the actual blocks themselves.
2012-11-03 20:29:34 -07:00
Mitchell Hashimoto
b659191a02 vagrant up! 2012-08-14 22:38:41 -07:00
Mitchell Hashimoto
0eddda3552 Halt works with new machine.
This required some modifications to the linux guest implementation. And
the other guests will have to be modified as well. This is because
`channel` is now `communicate`.
2012-08-12 18:54:52 -07:00
Mitchell Hashimoto
f9752d78d8 Properly resolve and load the guest class impl for Machines 2012-08-12 18:35:19 -07:00
Mitchell Hashimoto
5ae3e0e80c Allow the definition of communicators in plugins 2012-08-08 21:52:25 -07:00
Mitchell Hashimoto
a1cef830e3 Add the Communicator plugin API.
This allows communication protocols to be defined for the machine. This
is how things like SSH will be implemented.
2012-08-08 21:28:28 -07:00
Mitchell Hashimoto
1a2a8b49c0 Provider API to return SSH info, must implement ssh_info.
Since SSH is such a critical part of Vagrant, each provider must
implement a method that returns the proper way to SSH into the machine.
2012-08-05 12:41:05 -07:00
Mitchell Hashimoto
912998ef31 Fill in the provider API a bit more to what it is. 2012-07-16 15:24:51 -07:00
Mitchell Hashimoto
3519bf0372 Add the "provider" API to the V1 plugin. 2012-07-15 11:17:58 -07:00
Mitchell Hashimoto
436da57cc4 Add the #action API to the provider plugin 2012-07-14 17:04:06 -07:00
Mitchell Hashimoto
3b82f2efc4 Create the basic provider plugin interface.
Non-functional at this point.
2012-07-14 16:57:54 -07:00
Mitchell Hashimoto
70bdd9f56e Move host base class to a plugin component 2012-06-27 09:26:03 -07:00
Mitchell Hashimoto
53d8c28c8e Move guests to Vagrant.plugin("1", :guest) 2012-06-26 16:28:49 -07:00
Mitchell Hashimoto
b23dda54b8 Move command base class to a plugin component 2012-06-26 16:18:02 -07:00
Mitchell Hashimoto
7258daf535 Support specifying a component for Vagrant.plugin
The future of subclassing things like configuration bases and so on will
be to use `Vagrant.plugin(version, component)`. For example:
`Vagrant.plugin("1", :provisioner)`.
2012-06-26 15:47:26 -07:00
Mitchell Hashimoto
2e00a007ce Move provisioner superclass into the V1 namespace 2012-06-26 15:06:04 -07:00
Mitchell Hashimoto
41bc8e7454 Move Config::V1::Base to Vagrant::Plugin::V1::Config 2012-06-24 17:06:11 -07:00
Mitchell Hashimoto
ffab8cab68 Renamespace V1 plugin root to Vagrant::Plugin::V1::Plugin
This is mostly a transparent change to end users, but I'm going to put
all base classes for V1 into Vagrant::Plugin::V1.
2012-06-24 14:24:52 -07:00
Mitchell Hashimoto
de78a3637a Plugin activation
Vagrant is only guaranteeing that the plugin definition superclass (the
Vagrant.plugin("1") part) is backwards compatible. Anything else, such
as Vagrant::Command::Base and so on, will likely change in future
versions. Beacuse of this, plugins should only immediately expose their
definition.

In order to support loading the other classes, plugins should defer
loading to the "activation" phase of a plugin. This can be done using
the `activated` block:

    class MyPlugin < Vagrant.plugin("1")
      name "my plugin"

      activated do
        require "myplugin/my_command"
      end

      command("foo") { MyCommand }
    end

Plugin activation is done at two specific times:

  * Right when a Vagrant::Environment is created and the global plugins
    (such as from ~.vagrantrc) are loaded.
  * Right before loading configuration, but after the Vagrantfiles have
    been evaluated. This allows plugins to be defined within these files
    as well.
2012-05-21 22:23:50 -07:00
Mitchell Hashimoto
b7854c1ef6 Easy hooks 2012-05-05 22:31:21 -07:00
Mitchell Hashimoto
31ac7271aa Rename EasyCommand namespace to Easy 2012-05-05 22:16:13 -07:00
Mitchell Hashimoto
c2649074c3 Test command name validation and fix up some bugs 2012-05-05 20:11:26 -07:00
Mitchell Hashimoto
e4fa5bb489 Validate that commands only contain proper characters 2012-05-05 20:01:14 -07:00
Mitchell Hashimoto
00aba5ac03 Plugin easy commands.
Easy commands are well... easy! They don't offer the full power of
creating a completely custom command class, but they let you do the
basics (what almost everyone needs) with minimal fuss. Example:

class MyPlugin < Vagrant.plugin("1")
  name "my-plugin"

  easy_command "foo" do |action|
    puts "HELLO!"
  end
end

NOTE: The "action" stuff isn't done yet, but will be soon!
2012-05-05 18:57:29 -07:00