Commit graph

5636 commits

Author SHA1 Message Date
Chris Roberts
502644ea46
Merge pull request #13587 from betalb/vbox-virtio-scsi-controller
Add VirtioSCSI to the list of supported storage controllers for VirtualBox
2025-03-20 08:17:02 -07:00
Chris Roberts
75726b112a
Update RHEL guest networking
Recent versions of RHEL based guests have updated network configuration.
Detect the correct location of the network configuration files, and
configure the guest based on the detected location.

Fixes #13616
2025-03-19 17:42:11 -07:00
Chris Roberts
3fde423e96
Merge pull request #13622 from hashicorp/vagrant-go-rm
Remove vagrant-go implementation
2025-03-17 14:55:38 -07:00
Chris Roberts
e3a8d7f2cf
Remove vagrant-go implementation 2025-03-17 14:14:42 -07:00
Allison Larson
bc9f0b8c4c
Merge pull request #13564 from eszense/rmi-patch
docker/provider: handle variation in error text during image removal
2025-03-14 16:46:16 -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
11ca740311 Fix output message for box missing metadata 2025-03-03 14:58:45 -08: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
834e84fa6e Include arch constraint when checking global outdated boxes 2025-02-26 15:59:56 -08:00
Vitalii Ishchenko
28bb8ee1b5 Add VirtioSCSI to the list of supported storage controllers for VirtualBox 2025-01-29 23:18:08 +00:00
eszense
81d56a8af4
docker provider: Don't explode when removing an image if it is in use
Handles the slightly different error text when podman backend is used:
`Stderr: Error response from daemon: image xxx is in use: image used by yyy: image is in use by a container: consider listing external containers and force-removing image
`
2025-01-04 21:57:35 +08:00
eszense
be4ef73d31
Use ISO 9660 format in create_iso under darwin
Currently `create_iso` in darwin produces CD image with hybrid format HFS+ISO 9660
This is less interoperable than ISO 9660 alone. In particular, CD label is not readable by the udev and breaks some automated configuration system.
2024-12-29 23:49:30 +08:00
Chris Roberts
37b294680c
Update authentication handling with client wrapper 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
366c525539
Merge pull request #13525 from chrisroberts/encoding-error
Force encoding on command output strings
2024-11-01 14:08:55 -07:00
Chris Roberts
b5d62e2d81
Merge pull request #13343 from tnaroska/docker_build_containerd_fix
Fix#13342 adapt docker provider build for containerd storage
2024-11-01 14:07:00 -07:00
Chris Roberts
6be63b92e2
Force encoding on command output strings
Incompatible encodings will result in an error when the exception
is translated. The outputs may not be UTF-8 encoded so force
the encoding when providing the values in the exception.
2024-11-01 13:43:24 -07:00
Chris Roberts
d43f154032
Merge pull request #13517 from max-arnold/fix-salt-bootstrap
Fix Salt bootstrap script URLs
2024-11-01 12:14:48 -07:00
Chris Roberts
ffe6457171
Merge pull request #13493 from robinmulder/fix-ansible-version-match
Fix double digits Ansible version match
2024-10-30 12:47:03 -07:00
Chris Roberts
5e83b54195
Merge pull request #13513 from chrisroberts/vbox-7_1
Add support for VirtualBox 7.1
2024-10-30 12:32:14 -07:00
Chris Roberts
adcbd81eea
Merge pull request #13494 from MatrixDJ96/network_ip_ends_in_one_fix
Fixed conditions in network_ip_ends_in_one
2024-10-30 12:10:41 -07:00
Chris Roberts
85d97f5383
Add support for VirtualBox 7.1 2024-10-30 12:06:29 -07:00
Max Arnold
fd281cffcd
Switch to salt-bootstrap Github releases URLs
See https://saltproject.io/blog/salt-bootstrap-breakage-part-2/ for the explanation
2024-10-30 07:09:51 +07:00
Max Arnold
c9ca8e7c88
Fix Salt bootstrap script URLs
See https://saltproject.io/blog/salt-bootstrap-breakage/ for more details
2024-10-26 10:21:55 +07:00
Allison Larson
f977161282
Merge pull request #13496 from allisonlarson/allison-virtualbox-state-update
Update provider/virtualbox to allow paused state when booting vm
2024-09-23 12:04:49 -07:00
Mattia Rombi
a030ec068f Fixed conditions in network_ip_ends_in_one
Solve error: undefined method `end_with?' for nil:NilClass (NoMethodError)
2024-08-27 00:38:50 +02:00
Allison Larson
c4fa5df4f7 Add :paused to valid Virtualbox boot state 2024-08-26 09:45:50 -07:00
Robin Mulder
b357829dcc
Fix double digits ansible version match 2024-08-26 16:20:30 +02:00
Allison Larson
380eccc3b9 bsd/nfs: Check the status of nfsd before update/restart 2024-08-21 13:55:48 -07:00
Allison Larson
282b46904b bsd/nfs: Use nfs_update_command instead of restart 2024-08-21 10:49:47 -07:00
Allison Larson
a00483deba Move nfs mounting message within block 2024-08-20 11:06:35 -07:00
Allison Larson
2cb8183fe7
Merge pull request #13489 from allisonlarson/allison-docker-full-id
Match docker image id on full output from list when building
2024-08-16 10:17:17 -07:00
Allison Larson
1056f76922 Match docker image id on full output from list when building 2024-08-15 14:35:20 -07:00
Allison Larson
72579915d0 Pass docker exec_options to executor as kwargs 2024-08-14 13:52:12 -07:00
Chris Roberts
015e050195
Merge pull request #13346 from camillo-toselli/main
Update configure_disks.rb
2024-07-10 17:53:07 -07:00
Chris Roberts
22aad2b7d9
Merge pull request #13475 from hashicorp/container-id-matching
Properly match container ID when trailing content exists
2024-07-10 17:27:49 -07:00
Chris Roberts
e7142b6c09
Merge pull request #13411 from koberbe/bugfix/nfs-client-installation-stuck-on-debian
Make installation of NFS client on Debian non-interactive to prevent the process from being stuck
2024-07-10 17:08:22 -07:00
Chris Roberts
12df089810
Properly match container ID when trailing content exists 2024-07-10 16:56:32 -07:00
Chris Roberts
df5d8f11f5
Merge pull request #13373 from tomjn/patch-2
Check if the docker config is nil, fixes #13371
2024-07-10 16:42:12 -07:00
Chris Roberts
558682ad5b
Merge pull request #13375 from patrickpoortman/fix_gather_ansible_version
provisioner/ansible: Fix ansible version gathering in host provisioner
2024-07-10 16:25:23 -07:00
Chris Roberts
b71b9b5efc
Compact down config extraction 2024-07-10 16:07:26 -07:00
Chris Roberts
26831d99cc
Merge pull request #13409 from rgl/rgl-fix-openwrt-nfs-synced-folders
fix openwrt nfs synched folders
2024-07-10 15:17:59 -07:00
Chris Roberts
89f69e9697
Merge pull request #13383 from ALameLlama/feature/nicer-nfs-mount-message
NFS Folder Mounting message
2024-07-10 15:11:37 -07:00
Chris Roberts
4b7a465d23
Merge pull request #13394 from paulcacheux/fix-virtualbox-7-version-detection
virtualbox version detection: handle WARNING lines
2024-07-10 14:20:16 -07:00
Chris Roberts
0c328c39e2
Merge pull request #13362 from chadek/main
Adding warning for IPv6 ending with 1
2024-07-10 14:17:23 -07:00
Chris Roberts
67599f89e2
Cast to string to prevent error if no match is found 2024-07-10 13:53:41 -07: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
Kai Oberbeckmann
c75c872551
Make installation of NFS client on Debian non-interactive to prevent the process from being stuck 2024-06-14 11:12:04 +02:00
Rui Lopes
7dacc4b711
fix openwrt nfs synched folders
in openwrt, /sbin/init --version does not print the version, instead it calls init, which breaks the running system

this was already fixed in https://github.com/hashicorp/vagrant/pull/7813 but somehow was lost in later code changes
2024-06-10 10:44:38 +01:00
Paul Cacheux
f67d4f75eb
virtualbox version detection: handle WARNING lines 2024-05-20 14:50:01 +02:00
Nicholas Ciechanowski
b26482d23c feat: nicer message when mounting nfs folders 2024-04-22 16:20:03 +10:00
Patrick Poortman
94a888b260
Fix ansible version gathering in host provisioner 2024-04-02 14:37:07 +02:00
Tom J Nowell
ad92256190
adjust the fix for #13371 to conform to code elsewhere in the file and check for IPAM 2024-03-28 16:20:52 +00:00
Tom J Nowell
5a191b388b
Check if the docker config is nil, fixes #13371
Sometimes the host network has a nil config, causing a crash on vagrant up when checking the docker networks
2024-03-28 16:15:00 +00:00
Fabrice Meyer
1a576716b9 adding ipv6 condition to network_ip_ends_in_one
Signed-off-by: Fabrice Meyer <meyer.fabrice@gmx.fr>
2024-03-09 23:59:29 +01:00
Camillo Toselli
716f76b2a6
Update configure_disks.rb
fixed configure_disks.rb in hyper-v capabilities provider to allow creation and removal of additional disks,
2024-01-30 11:18:40 +01:00
Timo Naroska
ce15776b32 Fix#13342 adapt docker provider build for containerd storage 2024-01-27 23:30:57 -08:00
Chris Roberts
c239e37b2f Force config value type and add test coverage
When extracting the config value from the data, force it to an Array
type for the size check. Include a test case that includes missing
configuration information to verify it does not produce an error.
2024-01-23 13:57:04 -08:00
Lars Tobias Skjong-Børsting
7d8b5e45fc Fix undefined method `size' for nil:NilClass in network_defined? 2024-01-20 12:59:47 +01:00
Chris Roberts
5a7fd6b302 Inspect guest for supported key types
Updates the SSH communicator to inspect the guest sshd configuration for
supported key types when creating a new key to replace the default
insecure public key. If the guest cannot be inspected, the connection
will be inspected. If the connection cannot be inspected, it will simply
fall back to the original behavior of using an rsa type key.
2024-01-18 11:53:00 -08:00
Chris Roberts
0a8f99df52 Open private key file in binary mode when writing
Prevent newlines from being converted to CRLF when writing private key
to file.
2024-01-12 16:01:23 -08:00
Chris Roberts
da8bdae003 Adjust string syntax 2024-01-10 16:47:59 -08:00
Chris Roberts
4b4cdfabc3
Merge pull request #13326 from alexgit2k/support-ansible-pip-for-rhel-8plus
Support ansible pip-installation for RHEL 8 and greater
2024-01-10 16:46:42 -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
443ff01ab7 Add key_type configuration option for ssh
Adds a new `key_type` option to the Vagrantfile ssh configuration. It
defaults to :auto which allows auto detection of key type to use.
Otherwise it can be set to an explicit type supported by Vagrant.
2024-01-10 11:37:50 -08:00
alexgit2k
a4e3a71de6 Support ansible pip-installation for RHEL 8 and greater 2024-01-09 14:47:45 +01: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
6db640fb14 Adjust vbox hostonly config for ipv6
Check the type when an ipv6 address is being used. If the type does not
have a `6` suffix, append it.
2023-09-11 17:48:02 -07:00
Chris Roberts
f4142705ab
Merge pull request #13241 from lordgurke/fix-vagrant-13226-wrong-filename
Remove duplicate appending of "6" to network type
2023-09-11 17:45:34 -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
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
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
Max
8ecfe32021
Remove duplicate appending of "6" to network type
To distinct between IPv4 and IPv6 configuration, a "6" was added to the network configuration type if an IPv6 address should be configured. This is now duplicate, as with pull 13024 the same thing is already done prior, thus leading to a duplicate "6" at the end of the network config type, i.e. "static66".
2023-07-30 17:33:58 +02:00
Chris Roberts
cebfb7a63b Use key type supported by server if possible
Check the key types supported by the server. If the data is not
available, default to the previous behavior which is using the rsa key
type.

Update insecure key check to match against any key files located within
the keys directory. For now, this effectively allows matching either rsa
or ed25519 insecure private keys.
2023-06-26 15:07:58 -07: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
8e26495189 Project client and proc mapper fixes
Default the options for default provider so an options value is not
required when calling. The index for the proc lookup should use the key
method, not index.
2023-06-05 17:39:58 -07:00
Chris Roberts
1d991cb253 Rescue not found and return nil for machine box 2023-06-05 14:18:06 -07:00
Chris Roberts
6809812965
Merge pull request #13086 from dafyddj/fix/salt-highstate
Fix Salt provisioner for Windows guests
2023-06-02 17:44:49 -07:00
Chris Roberts
33bc24d9d7
Merge pull request #13194 from chrisroberts/ssh-comm-interactive
Remove keyboard-interactive authentication method
2023-06-02 17:14:23 -07:00
Chris Roberts
41342dceb3 Remove keyboard-interactive authentication method
The keyboard-interactive authentication method was added due to a
mis-reading of a reported issue where the box was not properly
configured for Vagrant. This removes the keyboard-interactive
authentication method which resolves a password prompting issue caused
by its addition.
2023-06-01 17:49:15 -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
Allison Larson
b651c65b54
Merge pull request #13166 from allisonlarson/verify_salt_download
Salt: Verify bootstrap-salt download
2023-05-22 09:54:00 -07:00
Allison Larson
7db87b9da3 Salt: Remove old bootstrap scripts 2023-05-19 16:09:46 -07:00
Allison Larson
2fa539e499 Salt: Download & verify shasum of default bootstrap-salt file 2023-05-19 16:09:46 -07:00
Allison Larson
ceddf2e6cd
Merge pull request #13153 from allisonlarson/docker_bridge_ip_update
Docker: Attempt using docker command for bridge ip
2023-05-19 09:14:04 -07:00
Chris Roberts
b0c5852145 Move constants to isolated file to be loaded on-demand
Since the protos are only loaded when the serve command is invoked, move
the constant alias definitions into an isolated file so they are only
loaded when needed by the serve command
2023-05-18 12:02:07 -07:00
Allison Larson
12b73a46b2 docker: attempt using docker command for bridge ip
Don't rely on `/sbin/ip` to fetch the docker bridge ip address, instead
first attempt to use the docker command to fetch it. If it fails, fall
back to previous behavior.
2023-05-18 10:54:38 -07:00
Chris Roberts
8e98c5ff1c Update locale preference for the virtualbox driver
Update the locale preference list to prefer UTF-8 variations of `C` when
available.
2023-05-17 11:59:05 -07:00
Chris Roberts
d53d8e61bc Fix LANG value used for VirtualBox driver
The VirtualBox driver sets the LANG env var to prevent localized output
being returned when executing CLI commands. If the `locale` command is
present, do a best effort lookup to determine the properly value to use
for the LANG environment variable.
2023-05-15 11:01:29 -07:00
Allison Larson
ec16a00560 docker: sync folders before preparing nfs settings
Re-order the `SyncedFolders` to occur before `PrepareNFSSettings`, ensuring that
the host & machine ips are set appropriately.
2023-05-12 11:04:05 -07:00
Allison Larson
10e45f1df1 Ignore inactive docker containers when assigning ports
Checks to make sure that a docker container is running before determining
whether or not the port is in use. This prevents the a port on an inactive
container from being treated as if it is use.

Fixes https://github.com/hashicorp/vagrant/issues/13110
2023-05-09 16:44:58 -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
Sophia Castellarin
bc1e00fc50
Merge pull request #13052 from soapy1/password-auth-ssh
Update connection settings when using a password to connect ssh
2023-02-22 14:15:46 -08:00
Sophia Castellarin
9efc3521d1
Merge pull request #13090 from soapy1/remove-virtualbox-hyperv-check
Removes check for hyperv being enabled when verifying virtualbox is usable on windows.
2023-02-21 17:17:51 -08:00
Sophia Castellarin
ec396ec842
Merge pull request #13054 from moritzheiber/fix_ansible_pip_install_version_mismatch
Fix installing Ansible provisioner with version and pip
2023-02-21 17:12:32 -08:00
Sophia Castellarin
58d629d9af
Merge pull request #13055 from Penaz91/artix-support
Artix Linux Host Support
2023-02-21 16:49:02 -08:00
Sophia Castellarin
a5983aabe1
Merge pull request #12280 from RudiMT/bugfix20210302/hyperv-enhanced-sessionmode-crash-2012R2
HyperV enhanced sessionmode crash on Windows Server 2012R2
2023-02-21 16:47:11 -08:00
sophia
38e6e86d80 Removes check for hyperv being enabled when verifying virtualbox
is usable on windows. Virtualbox has supported running with hyperv
since version 6.0.0 https://www.virtualbox.org/wiki/Changelog-6.0.
(Virtualbox 6.0 is currently EOL) So, this check is no longer
required.
2023-02-17 11:38:28 -08:00