5427 Commits

Author SHA1 Message Date
Sophia Castellarin
aee8d7b96e
Merge pull request #12785 from dustymabe/dusty-el9
Enhancements for EL guests capabilities
2022-08-01 12:10:40 -05:00
Paul Hinze
6f44de5076
Merge pull request #12813 from sni/patch-1
Update nfs_client.rb for rocky 9
2022-07-29 11:12:47 -05:00
Dusty Mabe
3ad20c4c7b guests: add Alma Linux guest support 2022-07-29 09:22:50 -05:00
Dusty Mabe
d82d0fb657 guests: make CentOS/RHEL flavor detection more dynamic
Instead of having to update these flavor.rb files every time a
new version of CentOS/RHEL come out let's dynamically pick up
the version (7,8,9) from the machine.

This was inspired slightly by the Rocky Linux guest flavor.rb.
2022-07-29 09:22:50 -05:00
Dusty Mabe
4336aff67d guests/centos: use GUEST_DETECTION_NAME='centos' to ID CentOS
This migrates the CentOS guest plugin to identify machines by
what is in os-release rather than based on if the /etc/centos-release
file exists.

It just so happens that the Rocky Linux plugin is set up to inherit
directly from :redhat (not :centos) and thus the CentOS flavor is
attempted before Rocky in the depth first search. For some reason
the rockylinux/8 vagrant box still has the /etc/centos-release file
in it even though it's only supposed to inherit from RHEL.

The almalinux/9 box does not have /etc/centos-release.
2022-07-29 09:22:50 -05:00
Dusty Mabe
3b1e277f72 guests: RHEL 9 and CentOS stream 9 are out 2022-07-29 09:22:50 -05:00
Paul Hinze
4c34c9d26e
Merge pull request #12646 from hashicorp/push-heroku-print-output
Print output when pushing to Heroku
2022-07-28 16:36:55 -05:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Sophia Castellarin
5170d83c21
Merge pull request #325 from hashicorp/load-external-plugin-config
Find type to unany objects when mapping
2022-07-26 14:15:33 -05:00
sophia
c2d8f892ac Find type to unany objects when mapping
find_types works fine until you have a module which has the same name but different case. For example, the VagrantVmware package is HashiCorp::VagrantVMwareDesktop. All the protos are at Hashicorp::Vagrant::… So, you end up with this fun

Object.constants.select { |n| n.to_s.downcase == "hashicorp" }
=> [:HashiCorp, :Hashicorp]

So, when trying to walk down the modules to find the right type to unany to, Vagrant sometimes takes the wrong path (eg. Down the HashiCorp module instead of the Hashicorp module).

This change will keep a list of the parent modules when walking down the module list. This way if a dead end is reached then Vagrant can go a level back and keep searching for the correct class.
2022-07-26 12:22:28 -05:00
Chris Roberts
54502d5d66
Merge pull request #324 from hashicorp/fix-packaged-hang
Fix hanging commands when using packaged installation
2022-07-26 09:12:50 -07:00
Chris Roberts
b917dc466a Implement stop on the ruby internal service 2022-07-25 14:30:45 -07:00
Chris Roberts
fda4aef9c7 Make server instance accessible, return integer value 2022-07-25 14:29:38 -07:00
Paul Hinze
fc76f71ffc
Fix vbox multimachine by setting provider parallel default correctly
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.
2022-07-25 15:52:11 -05:00
Sophia Castellarin
fe4956ac83
Merge pull request #314 from hashicorp/ruby-load-global-plugins
Load global ruby plugins
2022-07-25 09:40:00 -05:00
Sven Nierlein
8fe4ec4c8d
Update nfs_client.rb for rocky 9
Starting a rocky 9 box (having nfs shares) fails with: `No match for argument: nfs-utils-lib`.
Apparently Rocky 9 does not have a `nfs-utils-lib` but mounting nfs shares without nfs-utils-lib works fine.
So updating the nfs client install to only install `nfs-utils-lib` if the package is available. That way older rhel clones
should continue to work as well.
2022-07-21 13:49:31 +02:00
Paul Hinze
9ab94f9971
Fix crashes on Vagrantfiles with provisioners
I forgot to handle nil in the new PluginOptions stuff, and options are
nil for Provisioner plugins.
2022-07-20 17:36:05 -05:00
Paul Hinze
957d0d3779
Bring plugin options back to Ruby for providers and synced folders
This removes the need for the validation workaround for Docker, because
box_updated is once again available in that context.

We don't technically need the SyncedFolder priorities back on the Ruby
side, but wiring them through for symmetry.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/183
2022-07-15 12:14:47 -05:00
sophia
5bc7218a70 Load global ruby plugins 2022-07-13 14:08:46 -05:00
Paul Hinze
8d46b09a11
Fix Docker machines being lost in go side
By pruning machines that are in "unknown" status after each operation,
the Go code path exposed the fact that the Docker provider was not
updating the machine index during an "up" - leaving the state as
"unknown".

This is basically a bug within the Docker provider, so I think it's okay
to update the plugin code to correct this rather than working around the
issue in Go.

All we need to do is call `machine.state` instead of reaching through to
`machine.provider.state` while waiting for the container to be started.
That causes the extra logic for updating the machine index in
`machine.state` to fire.
2022-07-13 14:04:32 -05:00
Chris Roberts
da9892a62f Use #to_proto on class match, otherwise convert 2022-07-11 15:09:46 -07:00
Chris Roberts
2572d4f62b Include class where error originated 2022-07-11 15:09:21 -07:00
Chris Roberts
e082fd6359 Machine mapper no longer needs to load through environment 2022-07-11 15:09:08 -07:00
Chris Roberts
67895c927e Allow a machine client to load its target 2022-07-11 15:08:53 -07:00
Chris Roberts
d5ec939022 Request target in spec and allow conversion to machine 2022-07-08 16:38:03 -07:00
Chris Roberts
19b4adb3b8 Implement get_value rpc in vagrantfile client 2022-07-08 16:38:02 -07:00
Paul Hinze
ee8883153c
Make Docker provider work again post config refactor
- Allow machine.box to be empty without sadness (depends on
   https://github.com/hashicorp/vagrant-plugin-sdk/pull/182)
 - Get synced folder type from plugin name instead of defaulting to
   :virtualbox
2022-07-08 11:36:27 -05:00
Sophia Castellarin
66a22e5254
Merge pull request #303 from hashicorp/synced_folder_has_override_opts
Synced folder has override opts
2022-07-07 16:28:14 -05:00
Chris Roberts
f5d778d51a Revert "Merge pull request #300 from hashicorp/optimize-ruby-command-list"
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.
2022-07-07 14:03:56 -07:00
Paul Hinze
59a8e9bb0f
Merge pull request #306 from hashicorp/fix-capability-boolean-handling
Fix Type::Booleans leaking through capabilities
2022-07-07 14:21:05 -05:00
sophia
b17c36c7c7 Fix typo 2022-07-07 12:30:24 -05:00
Sophia Castellarin
0b53e06687
Merge pull request #297 from hashicorp/port-command-fix
Use remote provider
2022-07-07 12:21:48 -05:00
sophia
f1af42a7fc Don't use hash with indifferent access when converting hash
The HashWithIndifferentAccess will change all keys to strings when
merged with another regular hash. This causes errors in cases where
hashes are merged, for example in the action builder. Symbol/String
type data is kept over the wire, so there is no need to make the
mapped hash a HashWithIndifferentAccess.
2022-07-07 11:50:03 -05:00
sophia
73801703e7 Pass machine to provider capabilities 2022-07-07 11:49:57 -05:00
Paul Hinze
75d900c93b
Fix Type::Booleans leaking through capabilities
We had some cases where calling a capability that returned a boolean was
not getting correctly unpacked, so instead of `true` or `false` the
capability was putting out
`VagrantPlugins::CommandServe::Type::Boolean`.

This may have been happening in _all_ cases where a boolean was returned
from a capability and we just didn't notice it yet because the return
value was always truthy.

These tweaks should help ensure that Ruby types make it out where they
are supposed to be in Args::Direct usage.
2022-07-07 11:29:50 -05:00
Chris Roberts
1c26a4abb0
Merge pull request #300 from hashicorp/optimize-ruby-command-list
Optimize command list generation
2022-07-07 09:29:15 -07:00
Sophia Castellarin
186824a568
Merge pull request #302 from hashicorp/private-network
Rely on string/symbol maps for hash mapping
2022-07-06 13:20:41 -05:00
sophia
eeba305399 Rely on string/symbol maps for hash mapping
Relying on HashWithIndifferentAccess in Hash mappers results in
errors when hashes get merged in Ruby. When merges between regular
hashes and HashWithIndifferentAccess happens, then all the keys
from HashWithIndifferentAccess are transformed to strings.
2022-07-01 12:47:12 -05:00
Paul Hinze
fb2a102c71
Fix init and other commands that run without a project
The Basis needs to be able to respond to Vagrantfile() and
DefaultProvider() to make it through Vagrant::Environment
initialization.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/178
2022-07-01 11:56:08 -05:00
Chris Roberts
6aa50189a2 Return empty results when no content to parse 2022-07-01 08:57:28 -07:00
sophia
20ec85b021 Use remote provider 2022-06-30 16:57:41 -05:00
Chris Roberts
067e6aeed1 Add get commands implementation to client and server 2022-06-29 16:13:36 -07:00
Chris Roberts
ffa10b4d85 Return integer value from serve command 2022-06-29 16:11:53 -07:00
sophia
adadf26c9c Check if communicator is available before detecting guests 2022-06-29 17:23:43 -05:00
sophia
f4d3f38921 Fix type in communicator#ready funcspec 2022-06-29 17:23:42 -05:00
Sophia Castellarin
a08204d4ba
Merge pull request #299 from hashicorp/fix-ruby-tests
Fix ruby tests
2022-06-29 17:23:23 -05:00
sophia
67a5c43873 Add Machine state direct converter 2022-06-29 16:03:22 -05:00
Paul Hinze
986e3fb258
Merge pull request #292 from hashicorp/box-collection-nit
Scope down rescue on BoxCollection.find
2022-06-28 15:23:33 -05:00
Chris Roberts
6d4abe2b08 Remove old proto constants 2022-06-27 11:26:22 -07:00
Chris Roberts
a2e0c5619e Use __finalized variable to determine finalization 2022-06-27 11:26:08 -07:00