Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.
Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.
Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.
VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
Turns out I misinterpreted the behavior of a ruby method with a default
being passed nil so I assumed :parallel was effectively defaulting to
true when it is the opposite.
This reverts commit 1c26a4abb0c9e095b3f6ec9944c4b15f6f1cd064, reversing
changes made to 186824a568583d8f6f2a50501d940ed71608fa0b.
The changes broke plugin loading when using subcommands so these
changes will be reverted until the underlying issue can be
investigated and resolved.
- Defaultable needs to default to true when it's not specified
- We need to allow a non-defaultable provider to be selected if it shows
up in the config
* Populates ComponentOptions into plugin structs
* Maps options for legacy Provider Plugins into PluginOptions
* Demos use of PluginOptions in a stub provider
* Honors plugin priority and defaultable settings
It looks like I might have been the first to hit provider cabability
invocation in testing these changes, and so I found these few missing
methods on the client. They're just copied over from the other
capability hosts.
Calling capabilities on a provider also revealed that the wrong Machine
type was being pulled out of the funcspec args, so we had to correct
that too in order to get the capability calls working.
* `vagrant ssh` has a --no-tty flag colliding with the one defined in
`bin/vagrant` - in fact none of the flags in `bin/vagrant` are
processed in `serve` mode, so remove the code that captures them from
the CommandInfo OptionParser dance
* `vagrant ssh` has a `--plain` flag colliding with the one defined in
`internal/cli/base.go` - this flag was inherited from Waypoint, so we
can just rename it to line up with the (inversely defined) `--color`
flag used in legacy vagrant
Some commands like `vagrant init` and `vagrant box` should be able to
run successfully without a full Project available in VAGRANT_CWD (in
other words, they don't require that a valid Vagrantfile be available.)
Thus far we've been assuming that a Project is available when
dispatching commands, which mean that commands of this nature weren't
working.
Here we make the Basis available to serve as an alternative client to
Vagrant::Environment::Remote such that it can be instantiated and passed
through to commands. This required some changes to Environment::Remote
to make its interactions with the client more defensive, but we manage
to avoid needing to make any changes to the normal legacy codepaths.
Update the Ruby service implementations to use the funcspec util
module for generating spec content. A helper method is now used
for generating a parent class for services to subclass which
automatically includes all required modules for usage.