427 Commits

Author SHA1 Message Date
Chris Roberts
51adb12547 Add architecture support for boxes
Introduce support for handling box architecture. Adds a new
`box_architecture` setting that defaults to `:auto` which will perform
automatic detection of the host system, but can be overridden with a
custom value. Can also be set to `nil` which will result in it fetching
the box flagged with the default architecture within the metadata.

Box collection has been modified to allow existing boxes already
downloaded and unpacked to still function as expected when architecture
information is not available.
2023-09-14 16:15:03 -07:00
Chris Roberts
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -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
Chris Roberts
d83bfc0d40 Perform best effort ssl revocation check on Windows
When performing a request via curl on Windows using schannel, ssl
certificate revocation checks does not handle verification failures
gracefully when an error is encountered that is unrelated to the actual
revocation of a certificate.

A new option is available to perform best effort revocation checks on
curl, so this is enabled by default on the Windows platform. A new
config option (`box_download_disable_ssl_revoke_best_effort`) has also
been added which can be optionally enabled to restore previous behavior
which results in a hard error if any error is encountered.
2023-06-20 16:37:00 -07:00
Chris Roberts
0a20379b1a Enable deprecated key type and host key algorithm
Recent versions of OpenSSH remove support of ssh-rsa key types and host
key algorithms from the default conection configuration. Set options to
enable them and provide a configuration option which can disable them if
required.
2023-05-22 17:09:47 -07:00
Chris Roberts
7ab4deb8e2 Remove protobuf related loading from config
The final proto related constants were removed in #13031 but the proto
loading still remained. This removes the loading to prevent protos from
being loaded when not in server mode.
2023-05-02 08:48:52 -07: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
Chris Roberts
6d4abe2b08 Remove old proto constants 2022-06-27 11:26:22 -07:00
Chris Roberts
8a41ef3396 Remove previous proto generation helpers 2022-06-21 16:51:08 -07:00
Chris Roberts
babe5acdaf Remove custom to_proto methods from configs 2022-06-15 10:55:00 -07:00
Paul Hinze
49aa226613
Temporary workaround to let Docker provider work
Comment has the details, but this should hopefully be short lived
2022-05-25 16:19:50 -05:00
sophia
3e641fbe6b
Stub machine index proto mapper for environment test 2022-04-25 12:26:51 -05:00
sophia
d5aacc0bc6
Thrash around making to proto for config faster 2022-04-25 12:26:51 -05:00
sophia
f4811af759
Use symbol proto when protoizing plugin configs 2022-04-25 12:26:51 -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
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
a128d98dea
Move to_proto to config classes 2022-04-25 12:24:21 -05:00
sophia
0e40c2eb97
to_proto save point 2022-04-25 12:24:20 -05:00
sophia
abf0dddd12
Clean up parsing examples/test 2022-04-25 12:24:19 -05:00
sophia
0923f1edf2
Collect config for Vagrantfile config element that does not exist in Ruby 2022-04-25 12:24:17 -05:00
Rui Lopes
fcdc63ff89 let the user configure the cloud_init mime part content-disposition filename 2020-10-28 15:57:45 -05:00
sophia
e02bf717b9 Fully replace :nfs option with :type => :nfs for synced folders 2020-10-22 14:59:34 -05:00
sophia
f4640e49ff Ensure provider specific config gets transformed into common form 2020-10-06 16:27:20 -05:00
sophia
23901fddf5 Simplify vm config for determining fstab modification setting 2020-08-21 11:10:01 -05:00
Chris Roberts
cd2d84fda7 Adjust synced folder collection class 2020-08-19 15:00:40 -05:00
sophia
2239ee8582 Create Hash with type attribute 2020-08-19 15:00:40 -05:00
sophia
cde39e26ba Make mount options a synced_folder capability 2020-08-19 15:00:40 -05:00
sophia
afd2a28f60 Add synced_folder_capability 2020-08-19 15:00:40 -05:00
sophia
e7e956ca12 Fix a few deprecation warnings for ruby 2.7 2020-08-10 16:32:54 -05:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Sophia Castellarin
a2811909be
Merge pull request #11618 from jbonhag/fix/empty-box
Treat an empty box value as invalid
2020-08-07 11:18:33 -05:00
Jeff Bonhag
abf4a4c9c5
Display machine name in error message
Co-authored-by: Brian Cain <bcain@hashicorp.com>
2020-07-31 15:19:29 -04:00
Sophia Castellarin
3d4b721a22
Merge pull request #11579 from soapy1/provisioner-communicator_required
Provisioner communicator required
2020-07-17 10:45:34 -05:00
Jeff Bonhag
eecf1dbe57
Add validation error for empty box
This commit adds a unique error message for an empty box value. It
requires modifications to vagrantfile.rb because some Vagrantfile config
is used before validation occurs.
2020-07-13 17:46:28 -04:00
Jeff Bonhag
352b955d09
Treat an empty box value as invalid
This fixes an issue where having a box name set to an empty string will
cause all Vagrant commands to fail with an error like:

ArgumentError: Malformed version number string (random box name)

This may be related to #10663.
2020-07-13 17:37:13 -04:00
Jeff Bonhag
de461fa47c
Fix a couple of tests
Use subject instead of invalid_subject because the validation assertions
test the subject double.

This also adds an additional check when validating the `size` attribute
because it is only required for disks of type `:disk`.
2020-07-09 15:33:19 -04:00
Jeff Bonhag
33ef2ca017
Add machine name to error messages 2020-07-09 15:11:31 -04:00
Jeff Bonhag
52c1267b2c
Show duplicate values in error messages
This also prevents nil showing up as a duplicate value for disk configs
when `file` is undefined.
2020-07-09 15:10:50 -04:00
Jeff Bonhag
84d2c38cc2
Disallow multiple copies of the same ISO
This makes disk/dvd behavior more consistent, and makes it easier to
determine whether a dvd is already attached.
2020-07-09 15:09:10 -04:00
Jeff Bonhag
e21fb59380
DVD attachments should never be primary 2020-07-09 15:07:48 -04:00
Jeff Bonhag
8985369eab
Raise an error if disk files are re-used in config 2020-07-09 15:07:46 -04:00
Jeff Bonhag
c52eb1b44c
Feature: ISO attachment for VirtualBox
This builds on the existing disk functionality, and adds some special
IDE controller-related flavor.

Considerations for IDE controllers:
- Primary/secondary attachments, so that each port can have two devices
  attached
- Adding the ability to address a specific controller name for disk
  attachment

This also prevents a user from attaching multiple instances of the same
ISO file, because VirtualBox will assign each of these the same UUID
which makes disconnection difficult. However, if multiple copies of the
ISO are attached to different devices, removing the DVD config will
cause the duplicate devices to be removed.

We may want to consider additional work to make the storage controllers
truly generic.
2020-07-09 15:07:27 -04:00
Brian Cain
88c2bc2be1
Merge pull request #11541 from briancain/feature/hyperv-disk-mgmt
[Feature] Hyper-V Virtual Hard Disk Management
2020-07-06 15:24:29 -07:00
Sophia Castellarin
71620f6803
Merge pull request #11631 from soapy1/error-nfs-on-win
Error nfs on win
2020-07-02 10:19:06 -05:00
Brian Cain
d35feb62a3
Simplify key check for provider option config 2020-06-30 14:23:34 -07:00
Brian Cain
b36db04b3d
Validate and get default disk extensions for provider
This commit updates the hyperv and virtualbox provider caps to validate
and also return the default disk extension.
2020-06-30 14:23:34 -07:00
Brian Cain
c063ca6100
Replace invalid disk name characters with underscore 2020-06-30 14:23:34 -07:00
Brian Cain
96d19264b6
Automatically remove invalid file characters for disk name
This commit copies what Vagrant does to filter out guest names with
invalid characters, and applies the same regex to disk names.
2020-06-30 14:23:34 -07:00
Brian Cain
66fe2e2854
Ensure size param is set for a disk 2020-06-30 14:23:34 -07:00
Brian Cain
754928a206
Ensure provider_config is a hash before calling .empty? 2020-06-30 14:23:34 -07:00