4290 Commits

Author SHA1 Message Date
sophia
30ade2991b Emit warning message if using mfsymlink 2020-04-17 09:56:52 -04:00
sophia
307291b7f8 Add mfsymlinks as a default option for mounting smb folders 2020-04-08 14:52:37 -04:00
Brian Cain
dda2c8f913
Merge pull request #11411 from thunder-spb/alpine-ansbile-support
Alpine capability for Ansbile support
2020-04-08 09:43:53 -07:00
Sophia Castellarin
a3e8e822e4
Merge pull request #11465 from soapy1/quiet-cli-opt
Quiet cli option
2020-04-06 10:22:29 -04:00
Sophia Castellarin
cf9a690bc9
Merge pull request #11482 from soapy1/systemd-cap-halt
Use systemd to halt system if available
2020-04-06 10:18:53 -04:00
Alexzander thunder Shevchenko
4caa5e1434 Setting python version back to 3.x since there some issues with Ansible version detection for pip installation. 2020-04-05 15:03:01 +03:00
Alexzander thunder Shevchenko
d1d214f6e2 Set python version to 2.7 as all other ansible provisioners do 2020-04-05 14:46:33 +03:00
Alexzander thunder Shevchenko
d73c2c5fa7 Get back to install pip via get_pip script 2020-04-05 14:28:19 +03:00
sophia
39d7cd8997 Wrap all progress type outputs with rewriting to enable --no-tty 2020-04-03 16:28:59 -04:00
sophia
338f13a2ae Use systemd to halt system if available 2020-04-01 15:43:10 -04:00
sophia
777f680837 Use systemd to rebot system if available 2020-04-01 13:57:07 -04:00
Sophia Castellarin
0ca53d9e6e
Merge pull request #11356 from jackorp/vagrant-podman-container-build
Docker provider: catch container name when using podman.
2020-03-30 16:19:31 -04:00
Sophia Castellarin
54972c045b
Merge pull request #10592 from ichesnokov/master
Make sure that ips array contains unique values
2020-03-30 10:31:48 -04:00
Jaroslav Prokop
5208032594 Docker provider: catch container name when using podman.
When user is using podman's docker CLI emulation the containers would
fail to enter running state because the docker driver could not catch
the container name. This commit fixes that by adding a check if podman
docker emulation is used and pick the container hash correctly from the
output.
2020-03-25 19:34:31 +01:00
sophia
987ab17f4d Add suport for SMB on redhat 2020-03-25 12:27:04 -04:00
Sophia Castellarin
2dadeb3ee5
Merge pull request #11461 from soapy1/get-docker-image-id
Get correct docker image from build output
2020-03-24 09:27:20 -05:00
Sophia Castellarin
e07d3c80e2
Merge pull request #11355 from terryburton/master
docker provider: Don't explode when removing an image if it is in use
2020-03-24 09:22:36 -05:00
sophia
324294993e Check for docker buildkit output first
When buildkit is enabled docker will write out
`writing image <image id>`
When buildkit is not enables docker will write out
`Successfully builld <image id>`
It is more likely that searching for the `writing image` will not
clash with build output than when searching for `Successfully built`.
eg. when installing python packages with pip, it is common to use
the verbage `Successfully built`.
2020-03-23 13:54:49 -05:00
sophia
380c25a7ae Get last image id from docker output 2020-03-23 10:10:19 -05:00
Jeff Bonhag
6efdcd2068
Merge pull request #11430 from chrisroberts/winssh-hacks
Fix issues with Windows SSH provisioner (continued...)
2020-03-11 10:39:44 -04:00
Chris Roberts
7d44fef00e
Merge pull request #11428 from chrisroberts/fix/windows-reboot
Catch any StandardError exception while waiting for Windows reboot
2020-03-09 16:48:27 -07:00
Chris Roberts
193eb11277
Merge pull request #11427 from chrisroberts/fix/auto-hook-creation
Update dynamic action hooks implementation
2020-03-09 16:46:27 -07:00
Alexzander thunder Shevchenko
e3461d354b python3 setup
Python 3 setup for any mode;
Move python setup to separate method;
2020-03-07 16:31:55 +03:00
Chris Roberts
7c2083d5da Update how delayed actions are stored to avoid accessing uninitialized value 2020-03-05 13:25:57 -08:00
Chris Roberts
ec9d23a531 Update public key cap to use powershell 2020-03-04 15:08:03 -08:00
Chris Roberts
852c549886 Force powershell on connection for consistent behavior
This patches the connection instances generated for the winssh
communicator so when a command is executed it is always run
with powershell. This prevents inconsistencies with argument
handling based on what the default shell is set to on the remote
side.

Since powershell is the default, environment variable template
only needs to be set for powershell style. If the shell setting
is updated to `cmd`, the command will be properly prefixed.

Default shell has been updated to powershell, to prevent extraneous
wrapping where it's not required. The `#ready?` check has also been
updated to use a constant value, which is overridden within winssh
as a blank command is invalid.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
9a26c123b9 Use SFTP for Windows file transfer
SFTP is more reliable than SCP when dealing with unknown sshd
configurations on the server side. It also provides a convenient
facility for creating remote directories, so we can remove the
Windows-specific `#create_remote_directory` method.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
b2aa16dc78 Set remote script extension from local script extension 2020-03-04 15:08:03 -08:00
Jeff Bonhag
b6e8262bf2 Perform scp commands with powershell.exe
This commit includes a monkey patch for Net::SCP#start_command so that
PowerShell commands are escaped correctly.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
85f0fce57a Allow #provision_winrm to modify upload_path
We need to ensure that Windows files have an extension when provisioning
via WinRM.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
4b7d55afaa Fixup paths to work with server-side Bash
This commit normalizes our Windows paths to use `/` instead of `\`.
These paths are compatible with both cmd and PowerShell, and are
required if the server-side shell is set to Bash.

The OpenSSH server executes all commands inside a default login shell
which cannot be controlled by the Vagrant configuration. So what ends up
getting executed on the server side looks something like this:

    "c:\\program files\\git\\bin\\bash.exe" -c "C:\\Windows\\Temp\\vagrant-ssh20200130-41670-1w5nsjy.bat"

By flipping the direction of the directory slashes, we end up with:

    "c:\\program files\\git\\bin\\bash.exe" -c "C:/Windows/Temp/vagrant-ssh20200130-43415-f1d5n2.bat"

This works whether the server-side shell is set to cmd, powershell, or
bash.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
fcd07e3a37 Switch to PowerShell for create_remote_directory 2020-03-04 15:08:03 -08:00
Jeff Bonhag
8affdd24b6 Wire up inline command for popular Windows shells
* Remove connection between shell provisioner directory config and WinSSH
directory config because these should remain separate.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
ee486203d1 Introduce force_raw option 2020-03-04 15:08:03 -08:00
Jeff Bonhag
df7c11a3a7 Fix issues with Windows SSH provisioner
Windows commands that run over SSH are wrapped in a script that writes a
special marker to the two output streams (stdout and stderr).  This
allows Vagrant to consume the output streams.

Unfortunately, this leads to a sort of chicken-and-egg problem where no
commands can be run before a wrapper script exists. For example, you
can't make a destination directory to upload the wrapper script without
first creating a wrapper script to make the directory. :)

This commit changes the behavior of the WinSSH communicator to assume
that the destination directory already exists for provisioning scripts.

It also moves the default `upload_path` from the shell provisioner
config so we can have OS-specific defaults.

Finally, it introduces a Windows-specific #upload method which will
properly use a Windows path separator on a non-Windows host.
2020-03-04 15:08:03 -08:00
Chris Roberts
6f707c829d Catch any StandardError exception while waiting for Windows reboot
This prevents any unexpected connection related error from breaking
the wait loop while windows reboots. If an underlying problem unrelated
to the guest is causing exceptions, the exception will still be raised
to the user, simply after the loop has exceeded the defined maximum
wait time.

Fixes #11238
2020-03-03 17:02:04 -08:00
Chris Roberts
eba18091f9
Merge pull request #11391 from chrisroberts/fix/winrm-server-retry
Update exit code value used for retry check - ArgumentException
2020-03-03 16:26:33 -08:00
Chris Roberts
660166720b Update delayed execution implementation to utilized appended action hook 2020-03-03 16:23:31 -08:00
Alexzander thunder Shevchenko
8aa1aee155 Cleanup redundant lines 2020-02-23 20:33:53 +03:00
Alexzander thunder Shevchenko
24a3016f2b Add Alpine into provider capability 2020-02-23 20:31:07 +03:00
Alexzander thunder Shevchenko
5ea65e9534 Add Alpine Ansible capability 2020-02-23 20:30:35 +03:00
Jeff Bonhag
a10b2c3108
Fix #11403: Parse list dhcpservers output on VirtualBox 6.1 (#11404)
This commit creates a custom `read_dhcp_servers` method in the
VirtualBox 6.1 driver to handle changes made in the ouput of
`VBoxManage list dhcpservers`.

Tests for VirtualBox 6.1+ can no longer use the shared examples for the
VirtualBox 4.x driver, because the `read_dhcp_servers` change is not
backwards compatible.

This commit also creates the boilerplate for a VirtualBox 6.x shared
example in case we want to put tests there in the future.
2020-02-18 15:14:31 -05:00
Brian Cain
96d7c19c06
Abstract out recovery method for resizing disk failures
This commit moves out the recovery steps for failures when Vagrant
attempts to resize disks. It wraps itsemf in a begin/rescue in case an
additional error occurs, we can still surface the original error that
caused the resizing to fail.
2020-02-13 09:42:18 -08:00
Chris Roberts
e430809cdd Update exit code value used for retry check - ArgumentException 2020-02-12 16:42:21 -08:00
Brian Cain
625bbf9cc8
Add more specific rescue exceptions for when errors occur for resizing
disks
2020-02-12 16:26:18 -08:00
Brian Cain
42133ad34e
Move strings into locales file 2020-02-12 16:22:02 -08:00
Brian Cain
37f8df174c
Freeze all values in valid disk ext default types 2020-02-12 16:00:23 -08:00
Brian Cain
baabf6650f
Check for provider capability with disk_ext types before using it 2020-02-12 15:59:37 -08:00
Brian Cain
dafb60ad4f
Update experimental feature flag for disk 2020-02-12 15:38:34 -08:00
Brian Cain
c5f4534487
Add virtualbox capability for validating disk extension types 2020-02-12 13:21:09 -08:00