Commit graph

4531 commits

Author SHA1 Message Date
oss-core-libraries-dashboard[bot]
614fcb0549
[COMPLIANCE] Update Copyright and License Headers (Batch 1 of 7) (#13765)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-22 16:38:56 +05:30
Sebastien Dionne
81e6dfa595
Merge pull request #13731 from survivant/main
Fix typos and linguistic errors in documentation / hacktoberfest
2025-11-21 10:52:25 +05:30
Taru Garg
df215db4ae
Update box add action to pass arch correctly (#13699)
Currently, during the box add action env[:architecture] gets passed down to add_direct, however, there is no architecture in env, the correct arch which is set in Vagrantfile is box_architecture, this PR changes the action to pass down the correct parameter.

Closes: #13698, #13697
2025-07-31 21:16:30 +05:30
Taru Garg
56a91e9afd
fix(networking): Allow configuring guest network when there is more than one interface attached (#13686)
* Add support for configuring guest network when there are more than 1 interfaces attached
2025-06-19 10:22:21 +05:30
Chris Roberts
cc16c60b43
Add basic oscdimg detection on Windows
Check for the oscdimg executable on both the PATH and known installation
location. When not found, provider a user friendly error message about
the missing executable and a helper link on where it can be found.
2025-05-20 17:52:39 -07:00
Chris Roberts
f4fc2c742a
Update cloud-init behavior and iso generation
This includes a couple modifications to the cloud-init behavior.
First, the cloud-init wait action will now write a sentinel file
after successfully waiting for cloud-init. This results in subsequent
boots of the machine to skip executing the cloud-init wait command
as cloud-init is only executed on the initial boot.

Second, the cloud-init setup action will check for the sentinel file
written by the cloud-init wait action, and if detected it will skip
the cloud-init setup. When creating the ISO for cloud-init, a second
sentinel file will be used to log the path of the generated ISO
file. If the file exists, the ISO generation process will be skipped.
2025-05-14 12:57:03 -07:00
Chris Roberts
497e2daeca
Make box add failure messages more helpful
This adjusts the failure detection and errors raised when a box
cannot be added. New errors are added for when a requested provider
on a box does not support an architecture, and for when the no
providers on a box support an architecture. When box supports
an architecture but not with the requested provider, a list of
supported providers will be returned in the error message. If
a version constraint is requested and cannot be satisfied due
to provider and architecture filtering, the list of valid versions
will be provided.

Small change to the version list in the error output: the list
has been reversed so the most recent versions are listed first.
2025-04-30 17:50:27 -07:00
Chris Roberts
2f89b0537f
Properly handle multiple versions for internal specs
When building the internal specs collection, multiple specifications
may exist due to default gems. When building the collection, always
set the specification with the greater version. This change prevents
multiple versions of the same gem attempting to be activated.
2025-04-22 14:51:48 -07:00
Chris Roberts
12af53a6a3
Prefer pwsh executable over powershell excutable
Prefer to use the pwsh executable over the powershell executable
as the pwsh exectuable will be faster loading than the powershell
executable. If the pwsh executable is not found, the powershell
executable will be used instead. The preference can be overridden
using the VAGRANT_PREFERRED_POWERSHELL environment variable.
2025-04-15 14:15:56 -07:00
Chris Roberts
cc355dd0ef
Fix box add action to include architecture
If only one provider is available for the architecture, it is
selected, but when actually selecting it the architecture
constraint was not included. Depending on the order of the provider
list, the wrong value would be chosen.
2025-04-09 14:43:07 -07:00
Chris Roberts
1b44b8b71a
Merge pull request #13641 from chrisroberts/debug-log-additions
Add some helpful debug logs for more context
2025-04-08 17:19:07 -07:00
Chris Roberts
f4d9f75878
Fix arch guest networking setup
Updates network configuration capability in Arch Linux guest to
properly handle NetworkManager. Extracts NetworkManager setup
into reusable module.
2025-04-08 08:56:26 -07:00
Chris Roberts
75e45505f5
Add some helpful debug logs for more context 2025-04-07 16:05:10 -07:00
Chris Roberts
ea25996b21
Update Vagrant behavior outside of installers
Remove customized require behaviors and modify the bin executable
to check for missing tools that Vagrant expects to exist when
running outside of an installer.
2025-04-02 11:40:17 -07:00
Chris Roberts
4f79fe59c6
Provide configurable retries for connect on SSH communicator
Adds two new options to the SSH connect configuration: `connect_retries`
and `connect_retry_delay`. Provides user configurable values used when
establishing the SSH connection. Previous behavior would retry generally
by the default value without a pause between attempts. Updated behavior
will retry the number of times set within the config (unless value is
provided directly to connect call) and each retry will pause based on
the delay value set in the config (unless value is provided directly
to the connect call).
2025-03-20 17:44:47 -07:00
Chris Roberts
e3a8d7f2cf
Remove vagrant-go implementation 2025-03-17 14:14:42 -07:00
Allison Larson
d1f699b76b
Merge pull request #13606 from allisonlarson/catch-io-timeout-error
Catch IO::Timeout when waiting for communicator
2025-03-13 10:18:52 -07:00
Allison Larson
b6c7a15581 Catch IO::Timeout when waiting for communicator
Ruby 3.2 introduced a new error, `IO:TimeoutError`, for blocking
operations. Formerly, this case would return `Errno::ETIMEDOUT`. Catch
the new error while waiting for the communicator so that the retries can
be correctly attempted.

https://bugs.ruby-lang.org/issues/18630
2025-03-12 16:21:06 -07:00
Allison Larson
5564b8a1fd Determine compatible version when checking outdated box
When a request to check an outdated box (or update a box), add explicit
architecture compatibility check in addition to ensuring the version is
newer than before.

The architecture compatibility checks allow boxes that were marked as an
"unknown" architecture to see new "unknown" architectures as viable
update options, if an architecture specific provider is not available.
In the scenario that the existing version/provider has an explicit
architecture defined, a new version/provider with an "unknown"
architecture is not considered compatible.

This architecture check can be bypassed by explicitly setting
`config.vm.box_architecture = nil` in the Vagrantfile.
2025-03-03 14:58:45 -08:00
Allison Larson
1d5abc091f Pass architecture through box_collection 2025-02-26 15:59:56 -08:00
Chris Roberts
7f0f934537
Update silenced hosts constant for registry 2024-11-11 15:49:42 -08:00
Chris Roberts
6707633782
Remove unused constant 2024-11-11 15:49:42 -08:00
Chris Roberts
8b06640fcf
Use helper for require calls 2024-11-06 17:33:00 -08:00
Chris Roberts
b375e4d5b6
Remove activation at startup, add helper
This removes the gem activation from the startup and adds a
helper for properly activating gems based on the defined
runtime constraints of the vagrant specification at loading
time.
2024-11-06 17:33:00 -08:00
Chris Roberts
c58d872896
Bump version constraint for patching
Updates the version constraint defined for net-ssh patching to
include current lastest release.
2024-10-31 09:28:51 -07:00
Chris Roberts
881b9d6e5f
Merge pull request #13471 from calligraf0/main
possible fix for #13470
2024-07-10 14:59:39 -07:00
calligraf0
34160ff157 possible fix for #13470 2024-07-02 07:42:50 +02:00
Chris Roberts
4fc1311f93 Fix cloud provider upload command
Fixes the cloud provider upload command to properly include the architecture
value when determining the correct provider.
2024-06-26 08:44:36 -07:00
Chris Roberts
f7185bcd02 Force strict dependencies for default gems
When resolving for a plugin while within the installer, force strict
dependencies for all the default gems to prevent the resolver from
generating solutions where it may attempt to upgrade any of them. If
running within bundler, retain the same behavior and ignore them.
2024-01-18 17:24:48 -08:00
Chris Roberts
886aab2ff9 Load rubygem patches 2024-01-12 15:27:31 -08:00
Chris Roberts
606f825eaa Add patches for MakeMakefile
Provides patches for MakeMakefile and modifies the Ruby path provided
when building extensions to allow loading the custom mkmf.rb file.

The patches perform inspection of flag values and quote any Windows
paths found that are not already quoted. This resolves issues where
builds fail due to spaces in compiler and linker flags on Windows.
2024-01-12 15:24:09 -08:00
Chris Roberts
2d5c9c0d12 Patch net-ssh for ecdsa private keys
This patches net-ssh so it will properly handle loading and using ecdsa
private keys. Patching is restricted to tested versions.
2024-01-10 11:52:46 -08:00
Chris Roberts
96f2039bcd Use ssh key type defined by configuration
If key type is defined as :auto, detect best key type to use. If no
acceptable key type is detected as supported by the server, raise an
error. If unable to determine supported key types from the server,
fallback to original behavior of rsa type key.

If key type is defined as custom value, use that type if the server
supports it, or if the supported types cannot be read. Otherwise, raise
an error informing the user that the key type is not supported.
2024-01-10 11:52:46 -08:00
Chris Roberts
b934bd675c Add new key pair types
Adds ECDSA key types (256, 384, and 521) to supported types that can be
generated for key replacement on guest.
2024-01-10 11:33:30 -08:00
Chris Roberts
4e61783008 Fix autoload for Util::Keypair 2024-01-10 11:32:49 -08:00
Chris Roberts
b741d8332b Fix box collection sorting with mixed architecture
When the box collection consists of a mix of entries with architecture
information and without architecture information, ensure the values are
a common type so sorting does not result in an error.
2024-01-03 16:29:30 -08:00
Chris Roberts
3367154f5d Update CPU mapping values
Specifically for Windows hosts, the target CPU string will report as
`x64`, not `x86_64`. Include the value in the mapping to get the
properly value.
2023-10-19 10:48:18 -07:00
Chris Roberts
288f8ba552 Update path check for ssl helper
A path check is done prior to loading the vagrant ssl helper, but it was
only checking for a file with a `.so` suffix so `.bundle` files on macos
would be ignored and the helper not loaded.

Include both paths when checking for the library existence.
2023-10-18 17:44:18 -07:00
Chris Roberts
c8fc8b3ad2 Include newline on end of comment within private key 2023-10-02 15:38:02 -07:00
Chris Roberts
74b4a2b1f5 Adjust installation for unknown default architecture
When the reported architecture is unknown and the provider is listed as
the default architecture, add the box without architecture information
so it is installed without architecture information on the path within
the collection.
2023-09-26 16:20:37 -07:00
Chris Roberts
c8a7989b88 Adjust internal layout to allow downgrading
With the initial layout of `provider/architecture`, after installing a
box with architecture support downgrading Vagrant would result in it
being unable to process the box collection. Swapping the layout to be
`architecture/provider` allows downgrades to still properly process the
box collection.
2023-09-25 15:09:29 -07:00
Chris Roberts
3ea1beca9e Skip box directories without metadata file 2023-09-18 15:41:28 -07:00
Chris Roberts
9ef5c49598 Use api endpoint for expanded urls
When expanding the box url, prefer the API endpoint which is updated to
include provider architecture information. Test the API endpoint and the
legacy endpoint and use which ever is valid, with the API taking
precedence. This allows Vagrant to continue with non Vagrant Cloud
servers that do not implement the API endpoint.
2023-09-15 17:30:32 -07:00
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
7824c2dad2 Note when ssl helper was not found 2023-09-14 16:15:02 -07:00
Chris Roberts
eb5aaed72d
Merge pull request #13259 from chrisroberts/remove-exps
Remove experimental checks
2023-09-11 17:31:58 -07:00
Chris Roberts
910290f40a
Merge pull request #13252 from mattlqx/sparse
use the -S flag with bsdtar for sparse extraction of boxes
2023-09-08 16:17:34 -07:00
Chris Roberts
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -07:00
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
Matt Kulka
f5e0c12bb9
use the -S flag with bsdtar for sparse extraction of boxes 2023-08-24 13:09:18 -07:00