Commit Graph

3882 Commits

Author SHA1 Message Date
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
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
John Landis 19dc9fd921
Upgrade default Salt version from 2017.7.1 to 2018.3.3 2018-12-22 18:55:38 -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 9f1e7d9895 Prevent nil dup as unsupported in 2.3 2018-12-20 07:43:43 -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 ee2072ec53 Automatically answer yes when pruning SMB shares 2018-12-19 08:59:13 -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
hieptranquoc 480e992ea1 @ #10460 | vagrant rsync should restart when rsync find chown command error 2018-12-18 09:49:44 -08:00
hieptranquoc aa6908cc00 @ #10460 | fix vagrant rsync-auto is crashed 2018-12-18 09:49: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 0500f2b9b3 Add support for SSH config file to Rsync helper 2018-12-11 07:51:47 -08:00
Gavin Williams 122ef7307c Flesh out `:config` support.
Also noticed whilst testing that if the `ProxyCommand` uses `%r`, then
it fails with `unable to find remote user`, so added support for
`config.ssh.remote_user` aswell
2018-12-11 07:51:47 -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 87437317dc Add support for passing ssh config file in via config 2018-12-11 07:51:47 -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
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
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 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 d561116d16
Merge pull request #10474 from briancain/ensure-install_type-set-with-version
Fixes #10358: Add validation error in salt provider for certain options
2018-12-03 15:58:59 -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
Brian Cain 34b64ec247
Fixes #10358: Add validation error in salt provider for certain options
Prior to this commit, if you specified a `version` for the salt provider
but no `install_type` Vagrant would fail to pass the proper parameters
to the bootstrap install script. This commit fixes that by adding some
validation to the salt provider if `version` is specified but not
`install_type`. It also adds some extra context for certain config
validation error messages so that the user knows what option was
incorrect, rather than the message just referring to the option as
*this*.
2018-12-03 10:00:11 -08:00
Wolfgang Faust 4ec092f46d snapshot plugin: Raise error for bad subcommand.
Closes #9773.
2018-12-01 14:44:42 -05: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 69eacd2b73
Remove machine from initialize method 2018-11-30 11:03:05 -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 b8f5752a82 Update VM import for VirtualBox 6 driver
The dry run import with VirtualBox 6 no longer provides full paths
for disks. Extract base path from suggested settings file location
and use that to generate full path name using provided disk base
name.
2018-11-15 11:04:08 -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 7750d6182d
Merge pull request #10410 from chrisroberts/f-hyperv-net-typo
Fix typo in hyper-v network configuration detection script
2018-11-13 15:43:03 -08:00
Chris Roberts 8f49e05ad4
Merge pull request #10406 from chrisroberts/e-hyperv-destroy
Disable automatic checkpoints prior to VM removal
2018-11-13 15:22:11 -08:00
Chris Roberts 9dd137633a Fix typo in hyper-v network configuration detection script 2018-11-13 15:11:04 -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
Chris Roberts 0ea4dcdc6e Disable automatic checkpoints prior to VM removal 2018-11-13 13:09:12 -08:00
Chris Roberts 83ed01869d Ignore errors when generating new VM configuration
The default error action is to stop. When generating the initial
VM configuration during import, if the Compare-VM command fails
it results in a generic error message. Instead the error should
be ignored so the source VM can be inspected and a useful error
message can be returned to the user.
2018-11-13 12:21:17 -08:00