Commit Graph

195 Commits

Author SHA1 Message Date
Mitchell Hashimoto 184f6dccb2 Forward port GH-1142 2012-09-18 22:26:51 -07:00
Mitchell Hashimoto f7c231758f Forward Port GH-1140 2012-09-18 22:19:51 -07:00
Mitchell Hashimoto 678c6a070d VirtualBox 4.2 support 2012-09-13 19:11:32 -07:00
Hugo Wetterberg 17a6b64309 Emitting vagrant-mount events when mounting nfs volumes 2012-09-13 09:14:40 +02:00
Dan Midwood bdf72c5554 Use the communicate interface for ArchLinux guests 2012-09-02 18:00:11 +01:00
Mitchell Hashimoto 5691df37a1 Retry SSH on EHOSTUNREACH
This is one of those errors that happens once in awhile that can be
retried.
2012-08-29 13:39:03 -07:00
Mitchell Hashimoto ed1bc58735 Fix shell provisioner to run with new machine abstraction 2012-08-21 16:57:59 -07:00
Mitchell Hashimoto a238e06795 Fix up the chef solo provisioner to work with new machine abstraction 2012-08-21 16:57:17 -07:00
Mitchell Hashimoto f193d69fbc Fix up the debian guest to work with the new machine API 2012-08-20 14:58:58 -07:00
Mitchell Hashimoto 1efee6edcb Use the new communication interface for Ubuntu guest 2012-08-20 12:15:42 -07:00
Mitchell Hashimoto b328e95045 Make puppet provisioner work with latest machine changes.
Specifically it was still reference env[:vm] which is now
`env[:machine]`.
2012-08-20 12:13:04 -07:00
Mitchell Hashimoto 391dc39267 Merge branch 'machine-abstraction'
This branch brings in the "machine abstraction" code. This is a major
milestone in the development of Vagrant as it abstracts all of the
VirtualBox-specific code out into a plugin. There is zero VirtualBox
specific code in the core ("lib/") directory at this point. Read on for
important points.

== Gotchas

White it is technically possible now to write plugins for other
providers, there is still major work to be done to make this feasible.
The plugin interface itself is pretty much done, but there are some
issues:

* ":virtualbox" is the hardcoded provider to be used at the moment.

* There is no way to configure a provider. For example,
  `config.vm.customize` would never work for anything other than
  VirtualBox, so there needs to be a way to have provider-specific
  configuration. This will come soon.

* Shared folders and networking need to be rearchitected to be friendly
  for multiple providers, since it is unrealistic that a provider such as
  EC2 could provide the same level of networking, for example.

* There is no way easy way (like `vagrant package --base`) to create
  boxes for providers other than VirtualBox. This will be addressed in a
  whole new feature of Vagrant probably in a future release after
  provider stuff has shipped.

== Writing a Provider

To write a provider, you create a Vagrant plugin that defines a
"provider". See the "plugins/providers/virtualbox/plugin.rb" for more
details. Providers themselves have an exremely simple API. The burden
for writing providers mostly rests on the fact that you must define
complex middleware sequences.

Lots more work to come in the future, but this is a BIG MILESTONE!
2012-08-19 19:27:09 -07:00
Mitchell Hashimoto ba0e426507 Get vagrant package --base working in some hacky way.
`vagrant package --base` is deprecated for a future feature so I didn't
want to waste any brain cycles on how to do this the "right" way since a
new system will be introduced to do this sort of thing in teh future.
2012-08-19 18:51:36 -07:00
Mitchell Hashimoto 47fe278667 `vagrant box add` works again. Box verification remove temporarily.
The built-in middleware sequences will now be hardcoded onto
Vagrant::Action. Other plugins can hook into these sequences to provide
verification and so on. So the VirtualBox plugin will hook into that
action sequence and add verification.
2012-08-18 16:13:14 -07:00
Mitchell Hashimoto 85a4fb82a8 `vagrant package` a single VM works! 2012-08-15 21:04:37 -07:00
Mitchell Hashimoto b659191a02 `vagrant up`! 2012-08-14 22:38:41 -07:00
Mitchell Hashimoto aaeb060f33 `vagrant provision` 2012-08-14 21:21:31 -07:00
Mitchell Hashimoto 7aa083d259 `vagrant reload` now works with the new machine abstraction 2012-08-14 21:12:41 -07:00
Mitchell Hashimoto 85a499ffb8 Properly handle the case that VM doesn't exist for the VB driver. 2012-08-14 20:27:28 -07:00
Mitchell Hashimoto 0cc63c05e2 `vagrant destroy` fully works 2012-08-13 23:31:12 -07:00
Mitchell Hashimoto 2fc18f7207 `destroy` gets a little farther, and properly halts the VM 2012-08-13 23:18:50 -07:00
Mitchell Hashimoto bca8663742 `vagrant resume` works with the new machine abstraction 2012-08-13 20:03:35 -07:00
Mitchell Hashimoto db11c16b79 ssh_config works with new machine abstraction 2012-08-13 19:48:26 -07:00
Mitchell Hashimoto 83b908f3d8 `vagrant suspend` works with new machine abstraction 2012-08-13 19:30:41 -07:00
Mitchell Hashimoto aad022a626 Switch all `channel` to `communicate` in the linux guest 2012-08-12 19:03:31 -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 7efee573b8 `vagrant ssh -c` now exits with the proper exit code 2012-08-11 20:35:34 -07:00
jtimberman 50e9f83970 Add config.arguments for Chef
* Adds chef.arguments to Chef::Provisioner::Config
* Usable in both chef-client and chef-solo
* Specify as a string, "-L /tmp/foo.log", e.g.
2012-08-10 12:58:43 -06:00
Mitchell Hashimoto 5e70ad0ec2 `vagrant ssh -c` now uses a middleware sequence 2012-08-10 00:57:23 -07:00
Mitchell Hashimoto 64afd578b3 Just always return the SSH communicator for machines for now.
In the future we'll actually find a matching communicator but for now
since we're just focusing on machine abstraction, we just return SSH.
2012-08-08 21:57:08 -07:00
Mitchell Hashimoto 595e7cee0e Move SSH communication to a plugin 2012-08-08 21:48:51 -07:00
Mitchell Hashimoto f1c1dfad2f Some SSH command cleanup 2012-08-07 11:31:55 -07:00
Mitchell Hashimoto e0ec679838 `vagrant ssh` with full console works with new provider.
This works by now calling the `:ssh` action on the provider. This action
is allowed to do whatever it pleases, but should at some point probably
call the `SSHExec` built-in middleware.

The `SSHExec` built-in middleware was added. This uses the information
returned by `Machine#ssh_info` and uses the `Vagrant::Util::SSH` helper
to exec into the remote machine. The provider should do any work upfront
in verifying that the machine is ready to be SSHed into.
2012-08-05 13:45:24 -07:00
Mitchell Hashimoto 9db982f7a4 Expose the provider via the machine object. 2012-08-04 11:16:31 -07:00
Mitchell Hashimoto 002a83d7f7 Update SSH config help to properly reflect "--host" usage. 2012-07-30 11:42:29 -07:00
Mitchell Hashimoto 1e997f87d7 Clean up the actions a bit, move logic into actual middleware.
This is a good idea because in the future it will allow plugins to
properly override these behaviors.
2012-07-28 19:58:10 -07:00
Mitchell Hashimoto 31a3a3f2e2 Start moving the halt commands over to the new provider interface 2012-07-28 10:43:16 -07:00
Mitchell Hashimoto e5f250121a Call now only yields the environment 2012-07-27 19:34:46 -07:00
Mitchell Hashimoto 118377e6f0 Destroy sequence asks the user for confirmation. 2012-07-27 19:29:40 -07:00
Mitchell Hashimoto 90517a0f9b The `Call` built-in middleware allows for conditional MW sequences.
Read the documentation for more information.
2012-07-26 23:56:47 -07:00
Mitchell Hashimoto 5eed3b8417 Building up the `destroy` action again using new provider API.
This shows me moving the built-in middleware sequences to the provider
and how I'm organizing all that.
2012-07-26 22:39:27 -07:00
Mitchell Hashimoto 5e1bb5bf63 Fix typo to make puppet provisioners work again 2012-07-25 15:11:01 -07:00
Mitchell Hashimoto 44b4b9dfef Move drivers to the VirtualBox plugin. Use Machine class.
This starts the transition of replacing VM with Machine. Machine still
isn't ready to fully replace VM but by moving it now, I'm able to find
the spots that need to be fixed. At this point `vagrant status` works
with the new provider interface.
2012-07-24 21:32:38 -07:00
Mitchell Hashimoto 3519bf0372 Add the "provider" API to the V1 plugin. 2012-07-15 11:17:58 -07:00
Bob Maerten 3dda019cac change_host_name should change mailname too
On Debian systems config.hostname directive should change /etc/mailname
in order to prevent problems with default mailer trying to contact
default vm's name.
2012-07-13 15:07:56 +02:00
Mitchell Hashimoto c634cbedcc Handle interrupts more gracefully on the warning message 2012-07-11 18:47:41 -07:00
Mitchell Hashimoto 690d380b77 Use the new BoxCollection API 2012-07-11 18:41:13 -07:00
Mitchell Hashimoto f20666e230 Automatically upgrade the boxes all over. 2012-07-11 18:36:23 -07:00
Mitchell Hashimoto 23dfc45df2 `box repackage` now uses new Box API 2012-07-11 18:36:22 -07:00
Mitchell Hashimoto 6bb621026f `vagrant box add` uses the new API.
This assumes VirtualBox boxes for now, which is fine.
2012-07-11 18:36:22 -07:00
Mitchell Hashimoto 5b18a6525d `vagrant box remove` uses new API 2012-07-11 18:36:22 -07:00
Mitchell Hashimoto 6386ec2b79 `vagrant box list` uses the new collection stuff 2012-07-11 18:36:22 -07:00
Mitchell Hashimoto 2995b6439d Interrupt when asking to destroy a VM should exit. [GH-1017] 2012-07-11 18:33:28 -07:00
James Turnbull 97420a990a This commit has three minor changes to the Puppet provisioners:
* Renamed the run_puppet_client method in the puppet provisioner
to clarify it's function running Puppet in apply mode from the
command line.

* Renamed the run_puppet_client method in the puppet server provisioner
to clarify the agent is being run.

* Changed the Puppet server provisioner to use the more standard Git-style
command line structure. The puppetd binary has been deprecated in favour of
puppet with the agent flag.
2012-07-11 13:59:20 -04:00
Mitchell Hashimoto 627066c986 Point to TemplateRenderer properly in Chef provisioner base 2012-06-28 08:29:48 -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 55528e051c Move provisioners to Vagrant.plugin("1", :provisioner) 2012-06-26 16:04:51 -07:00
Mitchell Hashimoto 590f648fc0 Built-in plugins use Vagrant.plugin("1", :config) 2012-06-26 16:02:44 -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 9bc1ea5f04 Use config finalize to move some version-specific logic to the version
This moves out the concept of a "default VM" from the Environment class
and makes it the responsibility of the V1 configuration that at least
one VM is defined on it. This lets the configuration ultimately decide
what a "default" implementation is.
2012-06-23 12:48:53 -07:00
Mitchell Hashimoto 7e19d6849b Config loader no longer assumes latest version for procs.
Previously, all procs were assumed to just be the current version. This
is certainly not going to be true always so now the version number of
the configuration must be explicit if you're assigning a proc to the
configuration loader.
2012-06-23 12:06:54 -07:00
Mitchell Hashimoto 76f7da0618 FreeBSD guest network config upload must be a file. 2012-06-22 20:56:41 -07:00
Mitchell Hashimoto bd1def6b22 Renamespace Kernel to Kernel_V1 2012-06-14 18:49:20 -07:00
Jens Braeuer ae92895411 Fix problem that Puppet module-paths were re-ordered by Vagrant.
Puppet module-path were re-ordered by Vagrant due to the use of a
hash. This could lead to unpredictable results.
2012-06-07 20:37:15 +02:00
Mitchell Hashimoto da98ce59b3 Basic fixes to the configure_networks for Arch 2012-06-01 14:26:34 +02:00
Marco Monteiro f6c33fb4ef Fix reference to undefined variable 2012-06-01 14:24:15 +02:00
Marco Monteiro 5bbabaf5a5 Fix multiple ethernet interface support on Arch Linux 2012-06-01 14:23:15 +02:00
Mitchell Hashimoto a1b37980e3 Defer loading for commands to last possible moment 2012-05-23 16:18:29 -07:00
Mitchell Hashimoto 22e54eed58 Remove autoload from provisioners plugins 2012-05-23 16:07:08 -07:00
Mitchell Hashimoto 162227765f Change kernel plugin to use `activated` block 2012-05-23 16:04:41 -07:00
Mitchell Hashimoto 096e61b122 Get rid of autoload in hosts plugins 2012-05-23 16:03:14 -07:00
Mitchell Hashimoto 459d82689e Get rid of autoload use in Guests
I don't use `activated` here because I'd really like to optimize
performance as much as possible, and loading files from disk is
generally slow. So instead of using `activated` I load the file at the
last possible moment which is when the exact class is being requested.

I don't think many people will do this outside of the core, and I'm not
too concerned.
2012-05-23 15:57:43 -07:00
Mitchell Hashimoto 8846a19c70 Convert all command plugins to use the new `activated` block 2012-05-21 22:43:13 -07:00
Benedikt Böhm 46d72bb53a fix typo in change_host_name 2012-05-14 17:16:41 +02: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
Mitchell Hashimoto ca405b29f6 Don't support passing in the config into Chef anymore 2012-05-01 22:04:09 -07:00
Mitchell Hashimoto 804f6411fa Fix reference to the wrong error class 2012-04-30 21:07:09 -07:00
Mitchell Hashimoto 582f214024 Fix some basic mistakes with commands 2012-04-21 17:32:13 -07:00
Mitchell Hashimoto 9956e6d012 Better directory structure for plugins 2012-04-20 16:53:01 -07:00
Mitchell Hashimoto 86a846e445 Remove old command directory 2012-04-19 21:33:26 -07:00
Mitchell Hashimoto 6161c04fcf Fix some issues with commands not referencing proper classes 2012-04-19 14:02:03 -07:00
Mitchell Hashimoto 1489854d70 Move commands into plugins 2012-04-19 13:59:48 -07:00
Mitchell Hashimoto 661f20bb91 Move hosts to a plugin system 2012-04-18 22:20:45 -07:00
Mitchell Hashimoto 1cbac3167f Move provisioners into plugins 2012-04-18 21:53:19 -07:00
Mitchell Hashimoto 1b2fa748f9 Move all guests to plugins, even the distros 2012-04-18 21:23:25 -07:00
Mitchell Hashimoto 7766eb6098 Major guests have been moved to plugins 2012-04-18 21:03:03 -07:00
Mitchell Hashimoto d6d5475762 Add README to plugin directory 2012-04-18 17:48:06 -07:00
Mitchell Hashimoto dd459170dd Start moving guest configuration out into plugins 2012-04-18 17:38:20 -07:00
Mitchell Hashimoto a62e859231 Get rid of the UNSET_VALUE stuff, save it for v2 2012-04-18 17:09:25 -07:00
Mitchell Hashimoto b38fb5e974 Loader uses the new configuration classes 2012-04-18 17:03:34 -07:00
Mitchell Hashimoto 98d6bf958e Move core config into a plugin 2012-04-17 22:12:27 -07:00