Commit Graph

3304 Commits

Author SHA1 Message Date
Harry Weppner 250e74cb79 fix check for `docker-compose` 2017-06-08 11:09:41 -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
James Nugent b84acaed3c guests/smartos: Add/fix various guest capabilities
This commit adds/changes the following for SmartOS guests:

- modifies the "Halt" capability to use /usr/sbin/poweroff in preference
  to /usr/sbin/shutdown with parameters, and modifies the associated
  test.

- adds an "InsertPublicKey" capability and tests.

- adds a "RemovePublicKey" capability and tests.

With this commit applied, the vast majority of typical Vagrant workflow
is available to SmartOS global zone guests (provided NFS mounts are used
rather than VMWare shared folders).
2017-05-30 15:18:18 +01: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
Tim Aslat 630858b9a8 This patch fixes an issue when using rsync folders on windows clients with cygwin & ssh enabled.
Before the patch this error will happen if the original directory already exists

-------------------------------------------------------------------------------------------------
==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot
==> windows:   - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"]
==> windows: Showing rsync output...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir '/cygdrive/c/inetpub/wwwroot'

Stdout from the command:

Stderr from the command:

mkdir: cannot create directory ‘/cygdrive/c/inetpub/wwwroot’: File exists
-------------------------------------------------------------------------------------------------

After the patch, this is result

-------------------------------------------------------------------------------------------------
==> windows: Rsyncing folder: /vhosts/oxfamshop.com.au/ => /cygdrive/c/inetpub/wwwroot
==> windows:   - Exclude: [".vagrant/", ".git/", "target/", "node_modules/"]
==> windows: Showing rsync output...
==> windows: rsync[stdout] -> sending incremental file list
==> windows: rsync[stdout] ->
==> windows: rsync[stdout] -> sent 500855 bytes  received 6635 bytes  78075.38 bytes/sec
==> windows: rsync[stdout] -> total size is 175357552  speedup is 345.54
-------------------------------------------------------------------------------------------------
2017-05-16 16:38:29 +09:30
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
Brian Dwyer d427dd03d8
Add support for Kali Linux
Signed-off-by: Brian Dwyer <bdwyer@IEEE.org>
2017-05-02 23:30:10 -04: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
Chris Roberts 2c9cd87a71 Remove unused configuration options 2017-04-16 08:08:22 -07:00
Chris Roberts b35c68eacc Allow sudo wrapping but default to no-op 2017-04-16 07:59:29 -07:00
Chris Roberts c56acfab94 Add WinSSH communicator 2017-04-15 07:12:58 -07:00
Dafydd Jones 71216cf4f9 update latest salt minion version for windows 2017-04-13 12:36:45 -07:00
Martin Nowak 1ca247f516 fix `config.ssh.keys_only = false` for ansible
Also see #5017.
2017-04-12 12:31:00 +02:00
BJ Dierkes 55da086f5f Support for Elementary OS 0.4 - Issue #8471 2017-04-12 02:36:47 -05:00
Chris Roberts a60fe47965 Merge pull request #8428 from knbnnate/master
Salt ver year.month can have 2-digit month
2017-04-11 20:42:42 -07:00
Chris Roberts 21e195c75a Merge pull request #7425 from tjuerge/6220-mount_shared_folder-via-ssh
Add support for mounting synched folders on windows guest via ssh
2017-04-05 15:11:32 -07:00
Anand Suresh 30f4eb62ea Add chef_install(ed?) guest capability for freebsd 2017-04-04 22:10:02 -07:00
Chris Roberts df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07:00
Chris Roberts 05b6cdab6c Do not force docker host VM on Darwin or Windows 2017-04-03 14:48:14 -07:00
Chris Roberts 74ad90d8e0 Merge pull request #7840 from pstengel/bugfix/7651
Do better at finding ssh_info for Docker
2017-04-03 14:41:50 -07:00
Mikhail Zholobov 3c44ab7cf2
Escape backward slashes in vbox share name
That fixes invalid share names in Windows guests, where backward slash character is
used as a path separator.
2017-04-02 13:05:23 +02:00
knbnnate 8c31a0c3ff Salt ver year.month can have 2-digit month 2017-03-30 17:00:46 -04:00
Gökhan Şengün 51a15d23bd Correct box version sorting of box list command.
Boxes are already correctly sorted as a result of PRs #7956 and #8334. The extra sort here breaks.
2017-03-29 00:56:42 +03:00
Chris Roberts 4af1fbccfb Merge pull request #8410 from chrisroberts/fix/smb-mount
Fix linux guest mount smb capability
2017-03-27 09:07:22 -07:00
Chris Roberts 98b0ad1464 Fix linux guest mount smb capability 2017-03-24 13:42:51 -07:00
Gilles Cornu 80d105cf8c
ansible_local: Add the :pip_args_only install mode
With the introduction of `pip_args` option, you can easily extend the
`:pip` installation mode behaviour. But some interesting/advanced usages
are still not possible because of the auto-generated parts ("ansible"
package, version selection, and the `--upgrade` flag).

By adding this "pip_args_only" install mode, it will be for instance
possible to:
- install unofficial releases, like release candidates published at
  https://releases.ansible.com/
- install more pip packages (e.g. via a `requirements.txt` file), with
  hash validation, etc.

Note that there is no config validation that requires `pip_args` option
to be defined when the :pip_args_only mode is selected. This would be
more elegant, and user friendly to raise a configuration error, but this
can wait. At least, running with an empty `pip_args` won't lead to any
command crash, since the rather dummy "pip install" shows an helper
notice and terminates with a zero (0) exit code.

This change is thought as a complement to the changes originally
proposed in pull request GH-8170.
2017-03-24 17:35:34 +01:00
Simon Detheridge 3a3216ae0c gentoo/guest: #8406 support systemd when configuring net 2017-03-24 16:11:16 +00:00
Simon Detheridge e06848a649 gentoo/guest: #8406 support systemd when changing hostname 2017-03-24 16:10:52 +00:00
Gilles Cornu b40d347944
ansible_local: Polish the new `pip_args` option
Ref GH-8170
2017-03-24 00:01:17 +01:00
James Carr 7e2e5654ed
ansible_local: Add `pip_args` option
With this new option, it is now possible to pass additional arguments to
pip command when the `install_mode` is "pip".

(@gildegoma reworded the original commit message of pull request GH-8170)
2017-03-24 00:01:14 +01:00
Chris Roberts 256ce3b0d5 Merge pull request #8264 from hasyimibhar/command-validate
Add validate command
2017-03-23 09:52:12 -07:00
Chris Roberts e7abd1114b Merge pull request #8393 from chrisroberts/fix/default-provider-env-var
Prevent other provider install attempts when explicit provider given
2017-03-23 09:35:59 -07:00
Bjorn Brala 2f7e0d3a1f Virtualization extensions wern't enabled for vmcx file format, so it didn't work for Windows 10 and up. Fixes #8402 2017-03-23 07:54:41 +01:00
Bjorn Brala 0534ebf895 Merge remote-tracking branch 'mitchellh/master' into feature-hyperv-integration-services-fresh
# Conflicts:
#	plugins/providers/hyperv/action/import.rb
#	plugins/providers/hyperv/config.rb
#	website/source/docs/hyperv/configuration.html.md
2017-03-23 07:49:57 +01:00
Chris Roberts 72d0eb497d Isolate push deprecation to atlas strategy only 2017-03-21 15:08:17 -07:00
Chris Roberts 7c4252e24a Prevent other provider install attempts when explicit provider given 2017-03-21 10:58:06 -07:00
Chris Roberts 7a03c6e013 Add /bin/docker to path list for installation verification 2017-03-20 11:38:44 -07:00
Chris Roberts a0761eb2ea Allow initialization argument to be used in parent 2017-03-19 07:35:46 -07:00
Chris Roberts 1c1adcad9a Merge pull request #8325 from chrisroberts/enhancement/nested-hyperv
Nested Hyper-V
2017-03-17 14:19:58 -07:00
Bjorn Brala e2dd23b06c First implementation for Integration services for Hyper-V as discussed in https://github.com/mitchellh/vagrant/pull/6321 #6321 2017-03-15 22:12:19 +01:00
Björn Brala 765494a2bf Add configuration to HyperV config 2017-03-15 18:09:18 +01:00
Chris Roberts 6f578590a9 Skip forwarded port if disabled in docker provider 2017-03-09 10:28:41 -08:00
Chris Roberts dbf01572ef Merge pull request #8122 from chrisroberts/virtualbox/uid-gid
Use uid/gid from mount_options if provided for synced folders.
2017-03-06 14:21:11 -08:00
Chris Roberts 78e8e17869 Cast host value to string prior to empty? check.
Force string type prior to empty? check to prevent errors if
host ip value is nil. Add coverage for proper handling of nil
value.
2017-03-06 09:14:04 -08:00
Chris Roberts 6631fbdb9b Merge pull request #8073 from bshurts/fix/issue-7983
HyperV inaccurate winrm address - issue-7983
2017-03-06 09:11:34 -08:00
Chris Roberts e1e3df68da Merge pull request #7967 from apupier/removeRequirementsOnPathWithoutSpace
Remove requirements on path without space as issue was fixed in Ruby
2017-03-06 09:08:06 -08:00
Chris Roberts edd8a10b29 Merge pull request #8326 from chrisroberts/refactor/vbox-5.1
Refactor the virtualbox 5.1 driver implementation
2017-03-06 08:36:17 -08:00
Chris Roberts 6d3ab39b27 Merge pull request #7035 from pravinchandar/4608
Fix for #4608: Support for port forwarding in an IP aliased environment
2017-03-03 15:57:04 -08:00
Chris Roberts 98c50ee1c8 Refactor the virtualbox 5.1 driver implementation 2017-03-02 14:42:37 -08:00
Patrick Lang 8cf2240383 Finish hooking up hv.enable_virtualization_extensions 2017-03-02 14:06:39 -08:00
Patrick Lang 6900fc3904 Starting support for Hyper-V nested virtualization 2017-03-02 14:06:21 -08:00
Tobias e3e7484e16 Merge tag 'tags/v1.9.1' into patch-guest-esxi 2017-02-28 06:30:34 -08:00
Tobias cdeac10b36 guests/esxi: Added public_key capability 2017-02-28 02:35:00 -08:00
Chris Roberts 16c2b1ec50 Merge pull request #8291 from chrisroberts/enhancement/stderr-garbage
Discard initial stderr data
2017-02-24 07:34:28 -08:00
Chris Roberts 60cd9057a7 Add command deprecation module to push 2017-02-24 06:47:44 -08:00
Chris Roberts 64fd2f71d6 communicator/ssh: discard stderr data before command run 2017-02-16 15:43:04 -08:00
Chris Roberts 0c307476fa Merge pull request #8165 from kaorimatz/fix-arch-multiple-networks
guests/arch: fix configuring multiple network interfaces fails
2017-02-09 17:41:09 -08:00