Commit Graph

1978 Commits

Author SHA1 Message Date
Brian Cain 98e41eb936
Mock out public/private network calls for existing subnet tests 2019-03-21 13:26:37 -07:00
Brian Cain 32807d70c7
Mock up public/private network calls for #call test 2019-03-21 13:03:39 -07:00
Brian Cain 8c169714c5
Ensure variable names exist in method 2019-03-21 11:39:16 -07:00
Brian Cain 6ce453ab70
Delete old file and add blank describe blocks for remaining tests 2019-03-21 11:16:26 -07:00
Brian Cain 96a19aa00c
Fix how options to cli args are handled
Since options could also be defined as strings, convert it all to string
and compare those instead
2019-03-21 11:15:41 -07:00
Brian Cain 5215354d16
Fix missing docker error classes, and finish out initial #call tests 2019-03-21 10:50:45 -07:00
Brian Cain 75d6c17386
Fix up call method and add todo for prepare networks 2019-03-20 16:41:42 -07:00
Chris Roberts 2d5091a985
Merge pull request #10713 from renatoaguiar/fix-void-nfs
Fix NFS capability detection on Void Linux
2019-03-20 15:48:46 -07:00
Brian Cain 1027636e41
Split up and rename unit tests for docker network operations 2019-03-20 15:14:39 -07:00
Brian Cain eb75431c4a
Update docker driver and docker driver unit tests 2019-03-20 14:50:28 -07:00
Brian Cain c09bce5386
Fixup docker action destroy_network test 2019-03-20 13:35:46 -07:00
Brian Cain 5ed5868067
Inspect networks before creating new ones
This commit updates the behavior of how the docker provider creates new
docker networks. It looks at each existing network to see if the
requested subnet has already been configured in the docker engine. If
so, Vagrant will use that network rather than creating a new one. This
includes networks not created by Vagrant. Vagrant will not clean up
these networks if created outside of Vagrant.
2019-03-12 10:36:57 -07:00
Chris Roberts 1c650a7fb8 Remove whitespace from id file on load
If the id file includes whitespace, remove it. If the content of
the id file is empty, do not set the machine id.

Fixes: #10722
2019-03-11 17:08:13 -07:00
Brian Cain 2f0c66f832
Only enable shared folder mounts on freebsd guests
Since the virtualbox guest additions seem to only be available for
freeBSD, move the shared folder functionality over to freebsd guests
rather than all BSD guests.
2019-03-08 11:03:23 -08:00
Brian Cain fe002b7e48
Add unit tests for virtualbox shared folders 2019-03-07 10:35:37 -08:00
Renato Aguiar 4de7716ffb Fix NFS capability detection on Void Linux 2019-03-05 10:03:52 -08:00
Brian Cain 2be0bc2d81
Add unit tests for docker network actions 2019-03-05 09:49:15 -08:00
Brian Cain ba2a1224e0
Update driver to include network tests 2019-03-01 08:34:43 -08:00
Chris Roberts c0eaac791d Write metadata file to box contents during package
If the provider does not include a metadata.json file prior to
compressing the box, determine current provider and write
metadata.json file before compressing.
2019-02-28 15:31:49 -08:00
Brian Cain 1592c0c216
Merge pull request #10690 from briancain/cleanup-rsync-tmp-folders
Cleanup rsync tmp folders
2019-02-26 13:25:34 -08:00
Brian Cain 3b540e502f
Force removal of rsync tmp dir
Force delete entry to prevent any potentail failures when trying to
clean up the tmp dir from rsync
2019-02-26 09:08:56 -08:00
Chris Roberts e2b6a6645c Always ensure remote destination directory exists 2019-02-26 08:54:49 -08:00
Chris Roberts 6b105d704d Update communicator upload behavior to handle `/.` path directives
This update was prompted by updates in openssh to the scp behavior
making source directory paths suffixed with `.` no longer valid
resulting in errors on upload. The upload implementation within
the ssh communicator has been updated to retain the existing
behavior.

Included in this update is modifications to the winrm communicator
so the upload functionality matches that of the ssh communicator
respecting the trailing `.` behavior on source paths. With the
communicators updated to properly handle the paths, the file
provisioner was also updated to simply apply previously defined
path update rules only.

Fixes #10675
2019-02-26 08:02:09 -08:00
Brian Cain 401a571642
Add windows platform test for ensuring tmp file does not exist 2019-02-22 12:44:46 -08:00
Brian Cain 45ca16ffd5
Add rsync helper test for linux machines 2019-02-22 12:38:23 -08:00
Andrew Eikum 7517faa9ee
Remove tmpdir after rsync completes 2019-02-22 12:24:13 -08:00
Brian Cain cdcedb0a9e
Fixes #10682: Move over AddAuthentication middleware and hooks
Prior to this commit, the AddAuthentication hooks still existed in a
deprecated class LoginCommand. This commit fixes that by moving it over
to the vagrant cloud cli namespace instead.
2019-02-21 09:42:16 -08:00
Brian Cain 31b9aafcf7
Merge pull request #10622 from mattin4d/master
Change remaining box_client_cert refs to box_download_client_cert
2019-02-20 11:03:49 -08:00
Vidroha Debroy 7c0ffe369a Updated based on recommended changes per review. 2019-02-15 12:14:37 -06:00
Brian Cain 6b9cdb4e48
Fixes #10663: Ignore boxes in collection with malformed version numbers
Prior to this commit, if a box some how got on disk that had an
incorrect or invalid version number that did not match Gem::Version,
Vagrant would throw an exception when attempting to generate a list of
the boxes on disk. This commit fixes that by looking at the version from
the path generated, and shows a warning to the user about the box and
skips it from the list so they at least know about the problematic box
and can still get a list of boxes.
2019-02-14 15:30:11 -08:00
Brian Cain 68e21d8ac5
Merge pull request #10664 from chrisroberts/f-plugin-config-format
Fix format finalization of plugins in Vagrantfile
2019-02-12 10:00:14 -08:00
Brian Cain 26d05130c4
Merge pull request #10647 from chrisroberts/f-appimage-ld
Use ld path with appimage libs on suffix
2019-02-12 09:58:53 -08:00
Brian Cain 9636f59232
Merge pull request #10638 from chrisroberts/e-reboot-message
Add reboot output to guest capability
2019-02-12 09:57:30 -08:00
Brian Cain 0bc0bdd616
Merge pull request #10615 from briancain/introduce-typed-triggers
Introduce :type option for Vagrant triggers
2019-02-12 09:16:01 -08:00
Chris Roberts 2e58e002d6 Fix format finalization of plugins in Vagrantfile 2019-02-11 15:48:43 -08:00
Chris Roberts e165a5bc6e Update test checking ld path modifications 2019-02-05 07:16:40 -08:00
Brian Cain 91e351b937
Add unit test for dockers compare_synced_folders 2019-02-04 11:12:55 -08:00
Chris Roberts 80705c4804
Merge pull request #10637 from chrisroberts/f-address-config
Add base_address to core vagrant vm config
2019-02-01 16:15:50 -08:00
Chris Roberts ade5370db3 Add reboot output to guest capability 2019-02-01 15:47:02 -08:00
Chris Roberts 61cf179b42 Add base address attribute to vm config 2019-02-01 14:47:11 -08:00
Brian Cain 64e21a1215
Add test for Action classes with no name 2019-02-01 13:34:15 -08:00
Brian Cain 6ac23f1a15
Add fire trigger test for cli class 2019-02-01 13:34:15 -08:00
Brian Cain 16b5ad74ca
Handle command triggers with run_remote options
This commit adds some handling around when a machine does not exist at
all but a trigger was defined with a run_remote option
2019-02-01 13:34:15 -08:00
Brian Cain 09846b30fe
Fixup action tests
This commit fixes up the action tests by adding a `name` field for all
the Action classes used within the various tests.
2019-02-01 13:34:15 -08:00
Brian Cain fefb702359
Introduce `type` and `command` triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Chris Roberts d7e036981f Add coverage for windows path behavior in vbox6 driver 2019-01-29 11:09:30 -08:00
Vidroha Debroy 281203edf1 Handling the cases for UNSET_VALUE, i.e., config is not finalized. 2019-01-28 13:35:50 -06:00
Matt Adams a3836f5fec Change remaining box_client_cert refs
This fixes issues with box add/update when self hosting with client
certs. The --cert option was not being added to the curl subprocess
in these cases.
2019-01-28 08:45:24 -06:00
Vidroha Debroy d2c11e81ae Config has pip_install_cmd for Provisioner to pick it up. Tests updated. 2019-01-25 16:51:58 -06:00
Vidroha Debroy 84df098135 Handling empty strings passed as pip_install_command. 2019-01-25 14:55:39 -06:00
Vidroha Debroy 2b0617fb64 Adding pip_install_cmd as a default parameter to get_pip. Unit Tests. 2019-01-25 13:59:15 -06:00
Brian Cain 65a7261853
Fixes #10585: Properly set DHCP for systemd-networkd ips
Prior to this commit, if a debian system requested an DHCP address using
systemd-network, Vagrant would ignore it and instead use the configured
IP from the virtualbox network action. This commit fixes that by instead
looking if DHCP was requested, and if so, use that option for an IP.
2019-01-11 10:19:37 -08:00
Chris Roberts 88793bc706
Merge pull request #10574 from ngyuki/wslpath
Use wslpath command for customized root on WSL
2019-01-09 10:45:36 -08:00
Chris Roberts d8491b7120
Merge pull request #10550 from pkliczewski/master
dependency: update net-ssh version
2019-01-09 10:45:07 -08:00
ngyuki 380a1a01b7 Add test using wslpath command in vagrant/util/platform 2019-01-09 20:35:28 +09:00
Brian Cain 6b89324a9f
Merge pull request #10554 from iquiw/grep-fix-for-coreos
Fix grep command for network interface of CoreOS guest
2019-01-08 11:47:14 -08:00
Chris Roberts d87c645bd0 Fix garbage detection within SSH communicator
Fixes #10552
2019-01-07 16:20:56 -08:00
Chris Roberts 023238b3d1
Merge pull request #10528 from chrisroberts/e-ps-elevated
Add support for running elevated commands using the powershell command
2019-01-03 15:25:56 -08:00
Chris Roberts c7522b9114
Merge pull request #10529 from chrisroberts/e-rsync-chown
Add support for using the `--chown` flag with rsync when available.
2019-01-03 15:18:14 -08:00
Chris Roberts 1f959e03cb
Merge pull request #10532 from chrisroberts/e-reboot
Add reboot option to shell provisioner
2019-01-03 13:52:19 -08:00
Chris Roberts 7fbcb88d82
Merge pull request #10539 from jalandis/disable-required-install_type-salt-option-windows
Disabled salt provision required install_type check on Windows
2019-01-03 13:44:05 -08:00
Chris Roberts 4da035200f Update checkpoint client tests
Use `env.ui` for expectations instead of custom double. Fix upgrade
notification test and ensure upgrade notifications are sent to the
error channel.
2019-01-03 10:12:08 -08:00
Iku Iwasa 982534aaed Fix grep command for network interface of CoreOS guest 2019-01-04 00:25:35 +09:00
Piotr Kliczewski 0ad20f725b dependency: update net-ssh version
There is new net-ssh release [1] with a fix needed for vagrant-kubevirt.

Fixes: https://github.com/hashicorp/vagrant/issues/10421

[1] https://github.com/net-ssh/net-ssh/releases/tag/v5.1.0
2019-01-02 15:09:54 +01:00
John Landis bd6fa11281
Disabled salt provision required install_type check on Windows where option is not supported. Added test case for salt provisioner config changes. 2018-12-23 11:39:58 -05:00
Chris Roberts e735453422 Add reboot option to shell provisioner
Adds a `reboot` option which allows the guest to be rebooted after
the completion of a shell provisioning task. The guest must support
the `:reboot` capability. Like the `reset` option, the `reboot`
option may be provided without defining `inline` or `file` options
when a reboot may be required between other provisioners.

Fixes #8639
2018-12-21 15:50:59 -08:00
Chris Roberts cb3b8bd732 Add support for using the `--chown` flag with rsync when available.
Adds a new `rsync__rsync_ownership` option to rsync based synced folders
which will allow rsync to use the `--chown` flag if it is available. The
`rsync` and `rsync-auto` commands have a new `--rsync-chown` flag which
can be used to force the option on folders when running the commands.

Fixes #7329 #7332
2018-12-20 17:16:36 -08:00
Chris Roberts 9c33ffd3fa
Merge pull request #10527 from chrisroberts/f-configure-net-nm
Fix guest network configuration by properly extracting extra options
2018-12-20 14:00:30 -08:00
Chris Roberts e3cf74566c Add support for running elevated commands using the powershell command
This PR adds support for running command passed via the --command
flag as elevated tasks. The option is only valid for commands and
not when setting up a remote session. Logic has also been adjusted
for when communicator restrictions are applied and test coverage
has been added.
2018-12-20 11:30:25 -08:00
Chris Roberts f4cb33e954
Merge pull request #10012 from Aloz1/add-host-voidlinux
Add void linux host support
2018-12-19 16:21:52 -08:00
Chris Roberts a4a98d97fc Fix guest network configuration by properly extracting extra options
Extra options are extracted from the machine configuration for the
network being configured to allow for customized network manager
behavior. The network entries must be filtered to remove non-network
entries (like port forwards) before accessing by index.

Fixes #9546
2018-12-19 16:08:47 -08:00
Chris Roberts ac5b45445a Remove use of `system`. Add test coverage. 2018-12-19 12:19:22 -08:00
Chris Roberts 8eeb48daf6
Merge pull request #10469 from jlduran/fix-network-static
FreeBSD: Fix rcvar in network_static templates
2018-12-18 16:08:27 -08:00
Chris Roberts 818d1d97ae Update rsync auto post command error handling to be more generic
Rescue and re-wrap any errors encountered when running the post
rsync capability. Rescue this exception type and notify of error
when encountered by rsync auto. Include test coverage.
2018-12-18 09:50:21 -08:00
Chris Roberts 2daafd9586
Merge pull request #10490 from chrisroberts/f-snapshot-behavior
Update behavior of `snapshot restore` and `snapshot pop`
2018-12-13 09:18:20 -08:00
Chris Roberts 480bb47e1d
Merge pull request #10496 from chrisroberts/e-ssh-config-file
Add support for config and remote_user to SSH options
2018-12-13 09:16:49 -08:00
Chris Roberts 19025bb8c3
Merge pull request #10488 from chrisroberts/f-powershell-elevated
Only modify elevated username under specific conditions
2018-12-13 09:14:30 -08:00
Chris Roberts 90a5854684 Fill out ssh options config and remote_user
Include config option within ssh_config command output template. Default
remote_user value to set username value. Include existence check on
provided config value to ensure file is available. Update tests to
include coverage on all changes. Add new options to the docs.
2018-12-11 08:09:43 -08:00
Gavin Williams 87e38a0bed Remove 'config' from ssh.defaults, and instead setup in '.connect' 2018-12-11 07:51:47 -08:00
Gavin Williams 50a569747c Use 'be_falsey' matcher 2018-12-11 07:51:47 -08:00
Gavin Williams 87437317dc Add support for passing ssh config file in via config 2018-12-11 07:51:47 -08:00
Chris Roberts 598d4254be
Merge pull request #10489 from chrisroberts/f-lots-o-smb
Only prepare 10 shares per command to prevent exceeding allowed command size
2018-12-07 16:29:56 -08:00
Brian Cain 2011e213c3
Merge pull request #10485 from briancain/introduce-experimental-feature-flag
Add experimental flag to guard development features
2018-12-07 16:25:10 -08:00
Chris Roberts c999e7c3d4 Update behavior of `snapshot restore` and `snapshot pop`
Both of these commands failed to default the options disabling
the provisioning from ignoring the sentinel file. This resulted
in different behavior than what was seen with the `up` and
`resume` commands which would only provision items with run set
to "always". This defaults the options to proper match the behavior
of `up` and `resume` to be consistent.

This also adds an extra `--no-start` flag to allow users to restore
a snapshot but not start the restored guest immediately.

Fixes #6752
2018-12-07 16:17:44 -08:00
Brian Cain 2783b121f9
Remove VALID_FEATURES constant 2018-12-07 13:52:02 -08:00
Brian Cain accabdd7ca
Warn users about unknown requested experimental features 2018-12-07 13:36:16 -08:00
Brian Cain 01ec72cac2
Introduce a local and global check for enabled experimental features 2018-12-07 13:30:50 -08:00
Chris Roberts 924fb97e8c Only prepare 10 shares per command to prevent exceeding allowed command size
When a large number of shares are defined it may cause the generated
command to exceed the maximum allowed length. To prevent this, only
allow 10 shares to be processed at a time.

Fixes #10483
2018-12-07 12:56:55 -08:00
Chris Roberts 24cd988d39 Only modify elevated username under specific conditions
Elevated commands can fail via winrm under certain conditions like
the machine name being changed. Detect this by checking for a known
exit code combined with known output included within stderr. If found,
attempt to re-execute the command using a machine prefixed username
if possible.
2018-12-07 12:11:17 -08:00
Brian Cain d551738bc7
Allow feature_enabled? to accept symbols 2018-12-07 10:50:34 -08:00
Brian Cain fc4ba7f420
Update to global_enabled? 2018-12-07 10:50:20 -08:00
Brian Cain 1a32930017
Add guard_with method for protecting ruby blocks 2018-12-07 10:28:21 -08:00
Chris Roberts 55a8649963 Adjust requirement on warnings for VirtualBox NIC
The changeset _did_ get included in the 5.2.22 release so adjust
the requirement to only warn on previous versions
2018-12-06 15:40:31 -08:00
Brian Cain 119f82d826
Merge pull request #10479 from briancain/ensure-tmp-dir-cleanup-package-cmd
Fixes #9593: Ensure temp dir for package command is cleaned up
2018-12-06 15:08:18 -08:00
Brian Cain 212f6ce8bb
Add experimental flag to guard development features
This commit introduces a special flag for enabling features that are not
ready for release. It can either be enabled by setting the
`VAGRANT_EXPERIMENTAL` flag to "1", or by setting it to a string of one
or more comma seperated values for specific features. It also adds a
couple of Vagrant developer focused methods for making it easier to
determine if the flag has been enabled, and if so, what features.
2018-12-06 09:03:49 -08:00
Brian Cain 2038f2878c
Merge pull request #10470 from wolfgang42/snapshot-error
snapshot plugin: Raise error for bad subcommand.
2018-12-04 14:32:22 -08:00
Brian Cain 86e2b78997
Fixes #9593: Ensure temp dir for package command is cleaned up
Prior to this commit, the package actions would create a temp dir in
the process of packaging and compressing a Vagrant box. This commit
ensures that the temp dir is removed once the command has completed so
that it doesn't leave around lots of temp directories.
2018-12-04 11:07:53 -08:00
Brian Cain 6531ed0970
Merge pull request #10468 from briancain/raise-error-if-provider-file-missing
Fixes #10432: Validate that provider file exists prior to upload
2018-12-03 15:57:50 -08:00
Brian Cain 5fa3c5866c
Ensure tmp dir for validate is removed once command exits 2018-12-03 14:50:20 -08:00
Wolfgang Faust 4ec092f46d snapshot plugin: Raise error for bad subcommand.
Closes #9773.
2018-12-01 14:44:42 -05:00
Jose Luis Duran 5ab323733f
FreeBSD: Fix rcvar in network_static templates
The rcvar should be `defaultrouter` instead:

https://www.freebsd.org/doc/handbook/network-routing.html
2018-12-01 10:07:40 -02:00
Brian Cain 6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain 68dda8f853
Fixes #10224: Clear our registered providers when validating configs with no provider
Prior to this commit, if you went to validate your Vagrantfile and
wanted to ignore the provider, Vagrant would still fail as it checks if
there are any registered providers that are installed and usable. This
commit mocks out all registered providers to bypass that for the
validate command so that Vagrant can just validate the config and ignore
any provider config blocks.
2018-11-30 10:54:16 -08:00
Chris Roberts d589aa9f81 Update default_nic_type implementation within VirtualBox provider
In some cases the E1000 NIC type is the only acceptable value. Since
defaulting causes breakages to existing boxes, leave the default value
as `nil` but check the VirtualBox version in use and print warning to
user if VirtualBox version is vulnerable and E1000 NIC types are
configured for use within defined network adapters.
2018-11-26 15:58:45 -08:00
Chris Roberts f031ec4ce8 Add tests for VirtualBox driver version 6 2018-11-15 11:07:10 -08:00
Chris Roberts c5bc8aba46 Remove existing common tests to shared examples. Add custom import test. 2018-11-15 11:06:30 -08:00
Chris Roberts e86824e098 Move common virtualbox 5 driver tests into shared examples 2018-11-15 11:05:51 -08:00
Chris Roberts efbf99c451
Merge pull request #10409 from chrisroberts/e-vbox-ssh-port-detect
Update VirtualBox driver ssh_port helper
2018-11-13 15:44:15 -08:00
Chris Roberts c7721f619b Update VirtualBox driver ssh_port helper
Be more restrictive when matching the port forward used for
SSH. Allow matching simply on the guest port, but also include
extra matching criteria for cases where multiple results may
be returned.
2018-11-13 15:04:12 -08:00
Brian Cain 608863809a
Merge pull request #10405 from briancain/fixup-inline-windows-trigger-run
Fixes #10393: Only use Shellwords on non-windows hosts
2018-11-13 14:25:27 -08:00
Brian Cain 69b3b44505
Fixes #10393: Only use Shellwords on non-windows hosts
This commit updates how the trigger `run` inline option works by only
applying `Shellwords.split` to the inline command if it is going to be
run on non-Windows hosts. Otherwise pass the inline script directly to
be executed by Powershell.
2018-11-13 13:07:39 -08:00
Chris Roberts 3ebe5b40e3 Add test coverage on new functionality 2018-11-12 15:36:21 -08:00
Brian Cain a698188c12
Merge pull request #10389 from briancain/ssh-keyfile-paths-spaces-windows
FIXES #9870: Allow for windows path spaces with ssh utility
2018-11-12 09:14:01 -08:00
Chris Roberts f2c146d6d7
Merge pull request #10387 from chrisroberts/e-winrm-elevated
Prepend computer name to user when created scheduled tasks
2018-11-09 16:26:03 -08:00
Brian Cain f8bd2b3f82
Add test for private key paths with '%' characters 2018-11-09 10:46:22 -08:00
Brian Cain 80ac5aaf90
Use path as string rather than Pathname 2018-11-09 10:24:58 -08:00
Chris Roberts c8f431cf44 Prepend computer name to user when created scheduled tasks
When running a shell provisioner elevated with winrm a scheduled
task is created to bypass permissions issues. If the name of the
computer has changed this may no longer work. To prevent errors
this PR updates the implementation to fetch the computer name
and prepends it to the username before creating the task.
2018-11-08 14:21:20 -08:00
Chris Roberts d8bbc5ce09 Add support for specifying the default NIC type used for guest adapters
Provides support for defining the NIC type used for any guest adapter
which does not define an adapter type. This is defaulted to "virtio".
2018-11-07 15:53:46 -08:00
Chris Roberts 2808193a1a
Merge pull request #10368 from chrisroberts/f-box-load-meta
Fallback to Vagrantfile configuration when local metadata lookup fails
2018-11-07 10:12:29 -08:00
Brian Cain bcb6bf8acd
Merge pull request #10347 from briancain/add-timeout-for-ssh-info-hyperv
Fixes #10229: Add proper reboot capability for Windows guests
2018-11-06 09:25:36 -08:00
Brian Cain d2b7da065f
Add test for WinRMNotReady exceptions for ready? method 2018-11-05 14:14:50 -08:00
Chris Roberts 1885692f74
Merge pull request #10364 from chrisroberts/e-gem-dep-order
Update ordering of gem sources to ensure proper resolution
2018-11-05 12:50:26 -08:00
Chris Roberts d2d117471a
Merge pull request #10359 from chrisroberts/e-check-limits
Limit automatic box outdated checks to once per hour
2018-11-05 12:46:56 -08:00
Brian Cain 0188d409d4
Add test for windows reboot cap 2018-11-02 16:34:57 -07:00
Brian Cain 142a6898bc
Add reboot cap for windows
This commit introduces a proper reboot cap for Windows guests. Once it
initiates a reboot on the guest, it calls out to the wait_for_reboot cap
to block on until the guest is finished rebooting.
2018-11-02 15:25:57 -07:00
Mikhail Zholobov d9d081199c
action/network: Validate IP settings, show human-readable error 2018-11-02 22:29:19 +01:00
Chris Roberts d293e5dc08
Merge pull request #7693 from legal90/network_address
util/network_ip: Simplify #network_address helper
2018-11-02 14:08:49 -07:00
Chris Roberts 648be1369f Fallback to Vagrantfile configuration when local metadata lookup fails
The project local metadata file may contain invalid information to properly
lookup the configured box. This may occur if the file has been moved,
modified, or the backing box has been removed. In those cases, fall back
to the configuration defined in the Vagrantfile to load the box.
2018-11-02 13:59:53 -07:00
Brian Cain 54c8ebc31a
Fixes #10229: Add timeout for changing hostname on windows
Prior to this commit, if Windows was slow to reboot, Vagrant would fail
to find the right IP address to upload the wait_for_reboot script to.
This commit fixes this race condition by adding a timeout to ensure that
Vagrant can retry. It also properly catches an exception in the winrm
ready? method for checking if a guest is properly ready for
communications.
2018-11-02 09:23:00 -07:00
Chris Roberts 3daf3e532d Update ordering of gem sources to ensure proper resolution
In recent Rubies the first dependency to satisfy the constraint will
be used regardless if higher versions are available in subsequent
sources. Move custom source to start of list when resolving plugins
to provide desired behavior.
2018-11-02 09:14:27 -07:00
Chris Roberts 976320ec06 Limit automatic box outdated checks to once per hour 2018-11-01 09:45:11 -07:00
Brian Cain 6051f3598e
Fixes #10224: Allow validation of config while ignoring provider
This commit adds a new flag to the `vagrant validate` command which
allows users to completely ignore the provider block of a config file.
This is useful for when you are running `vagrant validate` in CI and
don't want to install a valid provider to check the syntax of your
Vagratnfile. When the flag is invoked, a warning will be displayed
saying that the provider block will be ignored and not validated.
2018-10-30 13:37:22 -07:00
Mikhail Zholobov 74de13cae5
util/network_ip: Simplify #network_address helper
Allow to use IPv6 net masks in string notation.
2018-10-28 21:17:43 +01:00
Chris Roberts ca81f9d6cb Prevent exception from raising on hyper-v check 2018-10-24 17:06:47 -07:00
Brian Cain 580bcaebb0
Merge pull request #10311 from briancain/DOCKER-VM-FOLDER-MOUNT
Deterministic host VM synced folder location for Docker provider
2018-10-24 16:19:41 -07:00
Brian Cain a1bb7b837a
Use semicolon over ampersand to separate commands 2018-10-24 15:27:33 -07:00
Brian Cain e8c6916ebc
Restart each interface if systemd-networkd or networkmanager is not used
This commit is a workaround due to how older debian and ubuntu systems
fail to properly restart networking. Instead of relying on the init
scripts or ifup/down tools to restart each interface, this commit
instead restarts each interface individually
2018-10-24 11:34:38 -07:00
Brian Cain 1761e65f26
Fixes #9763 #10300: Fall back on ifdown/ifup tools for network restart
This commit adds some additional logic that falls back to using the
ifdown/ifup tools to restart networking. On Ubuntu 14.04, the init
script was designed to always fail to restart newtorking, so it needs
to use the ifdown/up tools instead. This commit will use the networking
init script as a last resort to restart networking, assuming other
commands haven't broken networking already.

https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1301015
2018-10-23 14:47:12 -07:00
Brian Cain 7c06950e43
Ensure true or false for automount option 2018-10-23 09:00:55 -07:00
Brian Cain 6d0dfb2690
Fixes #10016: Add `automount` flag if specified with synced_folder
This commit adds a new option to virtualbox synced_folders called
`automount`, where if set to true, will supply the `--automount` flag to
virtualbox.
2018-10-22 15:45:32 -07:00
Chris Roberts 8562daf85e Prevent overly verbose output from SSH communicator
If the type of error changes on retry the messages will effectively
spam the user display with alternating messages. Log each message
sent and only re-display each message once within 10 seconds.
2018-10-19 15:18:03 -07:00
Brian Cain 65651178cd
Fixes #9591: Allow for 'default' smb_username if set
Prior to this commit, Vagrant would prompt for smb username and password
every time, even if only smb_username was defined. This commit changes
that by allowing a "default" username from the Vagrantfile, with the
option of overriding it.
2018-10-19 13:26:18 -07:00
Brian Cain e54c9b22ef
Merge pull request #10301 from briancain/debian-fixup-hostname-change
Fixes #9763, #10300: Split out how hostname is set with Debian hosts
2018-10-18 08:57:29 -07:00
Brian Cain 94bb50fa7e
Add test for syncing folders with docker provider 2018-10-17 14:14:27 -07:00
Brian Cain 0c5d55e69c
Fixes #9763, #10300: Split out how hostname is set with Debian hosts
Prior to this commit, the hostname was set with one big bash script and
attempted to determine what tools are available. This commit changes
that by splitting out that tool check on the Vagrant side of things with
the GuestInspection class, and adds back restarting networking to get a
DHCP lease with the change rather than using `dhclient`. This pattern
matches how hostnames are set in the redhat capability.
2018-10-16 12:00:25 -07:00
Brian Cain 42c01f241c
Mark password as sensitive in logs 2018-10-12 09:07:12 -07:00
Brian Cain e8115a4389
Update based on second round of feedback 2018-10-12 09:07:12 -07:00
Brian Cain d8ec19faa8
Fixup: Update vagrant cloud command PR with feedback 2018-10-12 09:07:12 -07:00
Brian Cain 3c45acc35f
Continue if entity already exists with publish command 2018-10-12 09:07:12 -07:00
Brian Cain 83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00