90 Commits

Author SHA1 Message Date
Chris Roberts
e958c6183a Adds initial HCP config support
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.
2023-09-07 17:26:10 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
sophia
686f9949fc Add plugin example of coloring terminal output 2022-09-14 11:42:54 -04:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Chris Roberts
b7eb55bbbc Update config testing builtin to include data checks 2022-06-24 18:28:46 -07:00
Chris Roberts
9b355854f0 Disable push config usage in test plugin 2022-06-15 12:49:22 -07:00
Chris Roberts
eb5c970b94 Include config test builtin 2022-06-15 11:15:39 -07:00
Paul Hinze
8b5d4b8631
Update and address protobuf package deprecations
These changes address the following warning showing up on `go get`
operations:

    go: module github.com/golang/protobuf is deprecated: Use the
    "google.golang.org/protobuf" module instead.

All changes are made using the recommendations in the per-function
deprecation notices from the docs at
https://pkg.go.dev/github.com/golang/protobuf/ptypes
2022-06-08 11:51:19 -05:00
sophia
0cdb63db58 Flush out http downloader 2022-06-08 10:30:46 -05:00
sophia
1af502ee9f Rename filedownloader -> httpdownloader 2022-06-08 10:30:46 -05:00
sophia
09f92f5ce9 Use http client as downloader 2022-06-08 10:30:46 -05:00
sophia
7282d43fae Make downloader plugin configurable 2022-06-08 10:30:46 -05:00
sophia
36081df049 Load filedownloader plugin 2022-06-08 10:30:46 -05:00
sophia
9c234618f3 Add downloader builtin plugin 2022-06-08 10:30:46 -05:00
Paul Hinze
8dbe72a5a0
Use Component Options to implement ProviderOptions
* 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
2022-06-03 16:37:05 -05:00
Paul Hinze
06350a7afc
Port default provider selection
- Pulls in the SDK changes to Project.DefaultProvider and Project.Target
- Implements the hefty default provider method
- Un-hard-codes provider from Target, and sets it when a Target is
  looked up from a Project
2022-05-25 16:19:50 -05:00
sophia
9094ac5869 Update donothing command to use localizer to just translate message 2022-05-16 13:51:57 -05:00
sophia
361f4ba9ba Load all localization files and allow sdk to choose the local language to use 2022-05-11 12:59:41 -05:00
sophia
5bfd9bda6c Enable english and spanish output for donothing command 2022-05-11 12:59:05 -05:00
sophia
25dfcd039f Update paths to use Path type instead of string 2022-04-25 14:12:28 -05:00
Paul Hinze
ff86d86ac8
Provisioner Plugins 2022-04-25 12:26:37 -05:00
Chris Roberts
920fd39ec1
Update builtin command to use CommandParams 2022-04-25 12:26:32 -05:00
sophia
be40120ddc
Remove current provider plugin 2022-04-25 12:26:23 -05:00
Chris Roberts
bd9ba0654e
Update builtins to use component command flag 2022-04-25 12:26:22 -05:00
Paul Hinze
92c345b42d
Allow go push plugins to use config from Vagrantfile
* Populate push configs when parsing the vagrantfile
* Allow untyped configs to be shipped over GRPC
* In our demo plugin, walk the vagrantfile and snag the config

Example Vagrantfile that works with the demo plugin:

```ruby
Vagrant.configure("2") do |config|
  config.push.define "myplugin" do |push|
    push.coolkey = "coolvalue"
    push.alist = ["so", "many", "items"]
    push.ahash = { "hashkey" => "hashvalue" }
  end
end

```
2022-04-25 12:26:21 -05:00
Paul Hinze
a841da4fc6
Add a simple push plugin in Go
The only tweak required to get this to work was allowing a DummyConfig
to survive being passed through a remote plugin on the Ruby side.
2022-04-25 12:26:21 -05:00
Paul Hinze
0fef7cc416
Port push plugins
This uses the new Push plugin support added to the plugin SDK in https://github.com/hashicorp/vagrant-plugin-sdk/pull/106 to make the following changes:

 * The plugin manager on the Go side now registers push plugins
 * The the _remote_ plugin manager on the Ruby side now calls over to
   the go side to get push plugins
 * All the wiring is hooked up such that when a push plugin is replaced
   with its remote GRPC-client-wielding equivalent, the messages are
   ferried around.
2022-04-25 12:26:21 -05:00
sophia
deb667ecd3
Use common rpc errdetails messages 2022-04-25 12:26:20 -05:00
sophia
bb084e42e4
Apply changes to download funciton 2022-04-25 12:26:09 -05:00
sophia
85f7aa1586
Make go communincator plugin work 2022-04-25 12:26:09 -05:00
sophia
a52b8b7fd3
Update dummy communicator 2022-04-25 12:26:08 -05:00
sophia
8e6dcac43e
Refactor myplugin
- add mappers for command options
- move communincator and prots into their own modules
2022-04-25 12:26:07 -05:00
sophia
f1e41a5c88
Add dummy communicator 2022-04-25 12:26:07 -05:00
sophia
f1f1b8c79d
Update parents -> parent 2022-04-25 12:24:48 -05:00
sophia
327db98656
Don't set parents for alwaystruehost plugin 2022-04-25 12:24:48 -05:00
sophia
cda3ba7b29
Make myplugin have parents darwin and bsd 2022-04-25 12:24:48 -05:00
sophia
7e3d2faa07
Add write_hello_file capability 2022-04-25 12:24:48 -05:00
sophia
ee7971ab1c
Go/Ruby host plugin dependency 2022-04-25 12:24:47 -05:00
sophia
a3d4c170f0
Fix guest plugin issues 2022-04-25 12:24:47 -05:00
Chris Roberts
661785771f
Update builtins to implement seed(s) function 2022-04-25 12:24:45 -05:00
Chris Roberts
821a982656
Add subcommand for running host capability 2022-04-25 12:24:43 -05:00
sophia
a23da9bc64
Log ruby detect endpoint 2022-04-25 12:24:41 -05:00
sophia
591dcced22
Remotve machine names function from project 2022-04-25 12:24:37 -05:00
sophia
827b50db77
Get client from machine go impl 2022-04-25 12:24:36 -05:00
sophia
545ddbdc74
Differentiate guest and host plugins 2022-04-25 12:24:35 -05:00
sophia
c19b3683db
Add alwaystrue guest plugin 2022-04-25 12:24:35 -05:00
Chris Roberts
3bbab430bc
Update builtin command to load target from project 2022-04-25 12:24:33 -05:00
Chris Roberts
8d52d9311e
Set custom plugin name for builtins 2022-04-25 12:24:21 -05:00
sophia
21a9827d53
Specialize a target given a type, and return an interface 2022-04-25 12:24:13 -05:00
Chris Roberts
22b8161e2a
Update output for test command 2022-04-25 12:24:12 -05:00