Commit Graph

3251 Commits

Author SHA1 Message Date
Brian Cain 3baa142e7c (#7685) Add a unique identifier to provision objects
Prior to this commit, Vagrant had no way internally to determine if a
provisioner object was unique if the `name` property was not set.
Because of this, when vagrant went to merge configs it would duplicate
an existing unnamed provisioner since it had no way of determining if a
user actually had added the same provisioner twice. This commit fixes
that by introducing an id which will default to `name` if its set, but
if not will be set by `SecureRandom.uuid`.
2017-06-13 15:46:14 -07:00
Brian Cain 6f21a19649 Merge pull request #8661 from briancain/6640/master/use-cipher-list-for-ssh-communicator
Use default cipher list for ssh communicator
2017-06-12 09:39:20 -07:00
Brian Cain 7a97f0a53e (#6640) Use default cipher list for ssh communicator
Prior to this commit, the ssh communicator would use the default cipher
list in Net::SSH to negociate which ciphers it should use between hosts.
Due to a bug in Net::SSH and the position of the `none` cipher in its
default cipher list, if a host supported the none cipher, but also
only supported other ciphers that came after none in the default list,
it would accept none and attempt to use that cipher instead of the other
supported ciphers. This commit fixes that behavior by copying the
default cipher list from Net::SSH and placing none last in the list so
that other ciphers can be used in the negotiation before attempting to
use the unsecure none cipher.
2017-06-09 17:18:15 -07:00
Brian Cain 87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07:00
Brian Cain 1ade699936 (#6827) Introduce tty flag for ssh command execution
Prior to this commit, if a user ran the `vagrant ssh -c CMD` command, it
would not allow the user to configure pseudo-terminal allocation. This
commit introduces a -t flag for the `vagrant ssh` command which defaults
to true if not specified.
2017-06-02 17:32:02 -07:00
Brian Cain eadb0ac831 Raise exception if provider doesn't have snapshot capability
Prior to this commit, if a user attempted to use the `vagrant snapshot
save` or `vagrant snapshot list` commands on a vm whose provider did not
support snapshots, it would simply print a warning. This commit changes
that behavior by instead raising an error.
2017-05-26 15:22:25 -07:00
Brian Cain 6ddba4f7b3 (#7810) Enforce unique snapshot names
Prior to this commit, the vagrant snapshot plugin would save snapshots
with existing names which lead to duplicate snapshot names being saved.
This commit fixes that by checking to see if the given snapshot name
already exists and if so, fails telling the user the given snapshot name
already exists. If a user passes a --force flag, vagrant will first
delete the existing snapshot, and take a new one with the given name.
2017-05-25 16:28:17 -07:00
Chris Roberts 27ca3ef831 Convert Windows paths in volumes if detected 2017-05-12 15:11:10 -07:00
Chris Roberts 36ecd40c52 Support optional detach and pass blocks through to execution. 2017-05-12 15:09:30 -07:00
Chris Roberts 6096bb299b Only set image if option given. Do not apply when setting build options. 2017-05-12 15:09:30 -07:00
Chris Roberts 42c9042221 Deep merge configuration settings and set any extra options 2017-05-12 15:09:30 -07:00
Chris Roberts 9242a69545 Allow direct set of composition and ensure basic types are used 2017-05-12 15:09:30 -07:00
Chris Roberts 4673bbb907 Properly define service build within composition. Full cleanup on destroy. 2017-05-12 15:09:30 -07:00
Chris Roberts b333e5cd82 Fix argument construction when adding dockerfile path
Fixes #7914
2017-05-12 15:09:30 -07:00
Chris Roberts d1c1c175a0 Support modifications of composition outside services 2017-05-12 15:09:30 -07:00
Chris Roberts d4bfade19f Include documentation on accessor in docker provider configuration 2017-05-12 15:09:30 -07:00
Chris Roberts deba93ce5c Add optional support for docker-compose
Adds configuration switch to enable using docker-compose
to create and manage docker containers.
2017-05-12 15:09:30 -07:00
Chris Roberts 5d83c03bfc Properly handle synced folders in docker provider on WSL 2017-05-12 14:05:12 -07:00
Chris Roberts 3c44ce9742 Support vbox provider within WSL rootfs. Make Windows access easier.
Enables proper setup of VMs started from within WSL rootfs paths. Updates
setup for Windows access when working within the WSL to auto-detect settings
instead of relying on user defined environment variables.
2017-05-12 13:11:53 -07:00
Chris Roberts 37901cd43c Merge pull request #8570 from chrisroberts/enhancement/wsl-support
Add support for running within WSL
2017-05-10 13:50:47 -07:00
Chris Roberts 2f5e15da55 Fetch first network device and pass to template for rendering 2017-05-10 12:44:37 -07:00
Chris Roberts a16b6f84e3 Remove reload via cli and just restart the service 2017-05-09 09:13:40 -07:00
Chris Roberts 39606e833f Update method documentation to correctly describe method 2017-05-09 09:13:14 -07:00
Chris Roberts c081916ce8 Always disconnect interface when controlled by NetworkManager 2017-05-08 19:30:35 -07:00
Chris Roberts 83b0c87f52 Support running Vagrant within the Windows Subsystem for Linux 2017-05-08 10:21:01 -07:00
Chris Roberts 8062b4f61f Merge pull request #8568 from chrisroberts/fix/hyperv-import
Update conditional check to use string equality
2017-05-08 10:17:35 -07:00
Chris Roberts af5f943123 Merge pull request #8567 from chrisroberts/fix/winssh
Enable capabilities for winssh communicator
2017-05-08 10:16:19 -07:00
Chris Roberts ffc6e3e282 Merge pull request #8566 from chrisroberts/fix/docker-ssh
Fall back to old style ssh info lookup in docker provider
2017-05-08 10:14:51 -07:00
Chris Roberts 9452e7cc38 Update conditional check to use equality check
Fixes #8444
2017-05-05 14:07:52 -07:00
Chris Roberts ee79dd0575 Enable windows guest capabilities using winssh communicator 2017-05-05 14:04:54 -07:00
Chris Roberts 62edaf5623 Allow shell to be defined when calling #execute 2017-05-05 14:04:54 -07:00
Chris Roberts 88dfe18a3f Fall back to old style ssh info lookup in docker provider
If ssh information cannot be properly extracted from within
the NetworkSettings data, fallback to original ssh information
implementation

Fixes #8552
2017-05-05 14:02:05 -07:00
Chris Roberts e5e0274ef5 Update hyperv and docker providers to raise exception on SSH when machine is not ready
This makes the behavior of the docker and hyperv provider consistent with the
virtualbox provider by raising an error on ssh actions if the machine is not
created or not running.

Fixes #8508
2017-05-05 14:01:12 -07:00
Chris Roberts 78e2bb513c Merge pull request #8531 from chrisroberts/network/guest-rhel
guests/rhel: Update network configuration
2017-05-01 15:56:25 -07:00
Chris Roberts 023a23403a Merge pull request #8433 from legal90/fix-os-friendly-name
virtualbox: Fix invalid share names in Windows guests
2017-05-01 15:49:13 -07:00
Chris Roberts 1df852c88a Reduce commands. Allow nm reload/restart to bring interfaces up.
Reduce the total number of commands run to configure interfaces. If
a service reload/restart is required, only execute it once instead
of once per device. When nm is managing a device, the explicit up
is not required.
2017-05-01 13:17:17 -07:00
Chris Roberts 71bfe7c884 Fix shell provisioner to execute batch files correctly
Call cmd.exe explicitly when running batch files to easily
manage special characters that may be within the path.

Fixes #8535
2017-04-28 15:05:08 -07:00
Chris Roberts 414184b76b guests/rhel: Update network configuration
Properly detects NetworkManager on guest as well as devices controlled
by NetworkManager. Provides configuration option to enable/disbale
NetworkManager control on devices.
2017-04-26 13:15:33 -07:00
Arjan Weurding 399789467a Fix crash when using HyperV
Fix the error 
```homestead-7: Creating and registering the VM...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: import_vm_vmcx.ps1
Error:

At C:\Program Files
(x86)\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyper                    v\scripts\import_vm_vmcx.ps1:18 char:37
+     [string]$differencing_disk=$null
+                                     ~
Missing ')' in function parameter list.
At C:\Program Files
(x86)\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyper                    v\scripts\import_vm_vmcx.ps1:20 char:1
+ )
+ ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInFunctionParameterList
```
2017-04-26 08:15:06 -07:00
Chris Roberts 2acded113c Retry SSH connection on Errno::ECONNABORTED
In some cases the SSH connection may be aborted while waiting
for setup. This includes aborted connections in the list of
applicable exceptions to retry on while waiting for the connection
to become available.

Fixes #8520
2017-04-25 13:38:24 -07:00
Chris Roberts e62d71b645 Remove comment removal from /etc/hosts file on guests
Fixes: #7794
2017-04-20 17:07:56 -07:00
Chris Roberts 0e89fdf182 Merge pull request #8498 from chrisroberts/win/spaces
Quote exec_path to properly handle spaces in path
2017-04-20 16:08:24 -07:00
Chris Roberts c963532d6e Use configured upload path for winssh communicator 2017-04-20 16:05:41 -07:00
Chris Roberts 82e268a3e2 Quote exec_path to properly handle spaces in path
Fixes #7234
2017-04-19 12:23:55 -07:00
Chris Roberts 067a0a5d0d communicator/ssh: Do not pass empty data to registered blocks
Prevent sending empty data strings to defined blocks handling
stderr and stdout output. These can occur when the garbage
marker is identified and collected data pruned, but no remaining
data is left to send.

Fixes #8259
2017-04-18 13:33:19 -07:00
Chris Roberts 232a44f46d Merge pull request #8485 from chrisroberts/communicators/win-ssh
Add winssh communicator
2017-04-17 08:21:33 -07:00
Chris Roberts e52821364a Merge pull request #8407 from gh2k/gentoo-systemd
Add support for gentoo guests that use systemd
2017-04-16 14:17:19 -07:00
Chris Roberts 9c127a4401 Merge pull request #8443 from anandsuresh/feature/freebsd-chef-installed
Add chef_install(ed?) guest capability for freebsd
2017-04-16 08:23:16 -07:00
Chris Roberts 1a17d829f5 Merge pull request #8472 from derks/elementary-guest
Support for Elementary OS 0.4 - Issue #8471
2017-04-16 08:16:06 -07:00
Chris Roberts 38a5f7c873 Merge pull request #8310 from tsmolka/patch-guest-esxi
guests/esxi: Added public_key capability
2017-04-16 08:13:26 -07:00