-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for host capabilities #2005
Conversation
So, while I could go ahead and copy & paste the current guest capabilities code to implement this I was wondering if we should have some sort of abstraction to deal with common logic (like looking up and calling capabilities for example) @mitchellh WDYT? |
I like this a lot. Yeah, I think |
@mitchellh awesome! I'll rebase this branch against current master and will continue working on it later on :) |
@mitchellh I did some work on this over the weekend but forgot to push :P In order to keep things simple I ended up copying and pasting The next step will probably be to do that extraction but I'll need some help with its name as I really can't think of one! I thought of |
Guys, unfortunately I'm not sure when I'll be able to get back to this =/ @mitchellh if you want to close the PR to keep it out of the radar I'm fine with that too. We can always continue the discussion "offline" if me or someone else is up to resume the work on it. |
Sure. No problem. I do still want to do this sometime. :) Thanks @fgrehm |
Yeah, this would be nice. |
WORK IN PROGRESS
So I've been willing to use Host capabilities to implement some vagrant-lxc host networking specific setup and I'm signing up for implementing support for this from within Vagrant's core.
Here's an initial list of "goals" and notes I've put up for making this happen (subject to change and open to suggestions of course :)
Allow plugins to register host capabilities (DONE)
Pretty much the same as Guest capabilities:
Split Host detection from capabilities
The idea would be to change the current host detection mechanism to use the same approach used for Guests, having the detection logic separated from the capabilities themselves and keeping a chain of detected hosts around for later usage when dealing with capabilities.
We might also need to introduce some sort of "Virtual Host object" to wrap things up but I'm not sure if we need all of this right now as we can probably just add the functionality to the base class (
Vagrant::Plugin::V2::Host
)Support for checking if host is capable of something / calling capabilities
Basically the same as we do for guest capabilities, with the difference that the "entry point" would be an instance of
Vagrant::Environment
instead of aVagrant::Machine
.The definition would also be similar to guest capabilities, with the difference that the first argument passed in would be an instance of
Vagrant::Environment
instead of aVagrant::Machine
.Make use of host capabilities from within Vagrant's core
Looking around current Host's implementation, the only candidates to be converted into Host Capabilities are NFS related stuff.