Commit Graph

885 Commits

Author SHA1 Message Date
Chris Roberts 48bb306d17 Update the wording to not assume latest WSL features 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 6d08d1c5bf #9298: Improve error message when WSL rootfs cannot be found 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 62740e2240 #9298: Increase stability of determination of a current WSL instance 2018-02-28 10:08:01 -08:00
Zachary Flower f46ebf5240 throw an exception when whitespace is found within an alias keyword 2018-02-16 13:28:57 -07:00
Brian Cain e8708232a5
(#9258) Exit if Hyper-V is enabled and VirtualBox provider is used
This commit adds a function on windows for the VirtualBox provider to
check if Hyper-V is enabled. If so, exit and display a warning to the
user that going forward will result in a system crash.
2018-02-08 11:20:41 -08:00
Chris Roberts 780673c6fe Add warning message for VirtualBox shared folders option.
Display warning to user about the VirtualBox SharedFoldersEnableSymlinksCreate
option with link to VirtualBox documentation and instructions on how the
setting can be disabled.
2018-01-20 06:51:59 -08:00
Chris Roberts f31badebb8
Merge pull request #9380 from chrisroberts/e-checkpoint
Update checkpoint integration
2018-01-19 15:06:28 -08:00
Chris Roberts b5383cffab
Merge pull request #9369 from chrisroberts/e-generic-sensitive
Add Vagrantfile configuration option to register sensitive values
2018-01-16 20:05:37 -08:00
Chris Roberts 58f66ac8ce Add full checkpoint integration 2018-01-16 14:16:49 -08:00
Chris Roberts f2f8bc2db5 Add Vagrantfile configuration option to register sensitive values 2018-01-15 07:23:47 -08:00
Chris Roberts 5444271268 Move SMB credentials validation into host capability 2018-01-12 16:55:35 -08:00
Lachlan Arthur 01bc2627be Check SMB credentials before using them 2018-01-12 15:46:31 -08:00
Chris Roberts b0fc6a06a1
Merge pull request #9294 from chrisroberts/e-smb
SMB synced folders enhancements
2018-01-12 15:02:08 -08:00
Brian Cain 11ddd0136d
(#9044) Show all box providers in command outdated
Prior to this commit, when the `--global` flag was used with the
`vagrant box outdated` command, it would ignore box providers and not
inform the user of all outdated boxes. This commit fixes that by
displaying each box within the users environment, and includes the
provider of the box in the message.
2018-01-08 09:43:28 -08:00
Brian Cain c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08:00
Chris Roberts 3eeff59329 Use custom types and messages for errors 2018-01-02 14:36:28 -08:00
Chris Roberts 98ec1af30e Add smb_start capability for darwin 2018-01-02 11:21:50 -08:00
Chris Roberts 68439f6bac Use sudo for sharing lists on darwin platform
On systems prior to high sierra the sharing binary
requires root user for access, so use sudo to get
full list output and inspect output.
2017-12-21 14:53:55 -08:00
Chris Roberts 81cbdae62a Make powershell error generalized 2017-12-21 09:55:19 -08:00
Chris Roberts 5a607d9248 Clean up SMB related errors 2017-12-21 09:55:19 -08:00
Chris Roberts 00fa50c296 SMB enhancements 2017-12-21 09:55:19 -08:00
Brian Cain 0d7ad9f18f
Merge pull request #9275 from zachflower/validate_ip_addresses
Add a clean error message for invalid IP addresses
2017-12-15 11:22:03 -08:00
Brian Cain 144c402f3b
Merge pull request #9252 from briancain/9055/master/pretty-print-nameerror-exceptions
Print more helpful error message for NameEror exceptions
2017-12-15 09:19:26 -08:00
Brian Cain 627babe15e (#9055) Print more helpful error message for NameEror exceptions
This commit adds some additional handling for when Vagrant loads config
files. Instead of showing the basic ruby exception, it prints a more
helpful error message and tries to direct the user to the line number
and file where the exception is occuring.
2017-12-14 15:31:48 -08:00
Zachary Flower 4a4183398b Add a clean error message for invalid IP addresses 2017-12-14 14:57:21 -07:00
Zachary Flower abb1149190 Raise an exception when the template cannot be found, and update tests accordingly 2017-11-17 12:20:03 -07:00
Brian Cain 401f1d521e
Merge pull request #9131 from bpietraga/fix-outputh-pathname-folder-creation
Fix --output path with specified folder
2017-11-15 09:55:32 -08:00
Bernard Pietraga b026be7cb3 Fix --output path with specified folder 2017-11-04 12:00:55 +01:00
Brian Cain d8bffd201f Add delay for parallel destroy without force, restructure state checking
This commit adds better messaging to the user if the parallel flag is
used without the force flag. It also makes the state checking based on
the delta between the initial and final states of the guests due to the
fact that there is no guarantee what the "destroyed" state id will be
between providers.
2017-10-31 13:52:07 -07:00
Jonathan LaBroad 56861296fa Added tests and validation for python_version parameter 2017-10-05 06:25:36 -04:00
Chris Roberts 34addec796 Merge pull request #8913 from mitchellh/gildegoma/6570-ansible-compatibility-mode
Ansible: Add "compatibility_mode" and "*become*" common options; Move "version" to common options
2017-09-06 13:18:08 -07:00
Gilles Cornu 4dc3e59b08
provisioners/ansible(both): Review of PR #8913
- Keep the Programming Errors with corresponding Exception class and
  en.yml message template. Fix the alphabetical order in errors.rb by
  the way.
- Fix English wording in the documentation and en.yml messages
- Use StandardError for unknown error rescuing.

Thanks @chrisroberts!
2017-09-06 17:12:50 +02:00
Gilles Cornu dec09f350b
provisioners/ansible: Fix wording and link in i18n en.yml messages 2017-09-06 17:12:42 +02:00
Gilles Cornu dc3b6341e2
provisioners/ansible: Check compatibility conflicts
Vagrant will verify that the current Ansible version does support the
requested compatibility mode (only applicable if not "auto", of course).

As mentioned in the documentation, there is no sanity checks between
`version` option and `compatibility_mode` option.

With this change, the host-based provisioner is also improved to
execute only once the "ansible" command (and store the gathered
information for multiple usages like version requirement and
compatibility checks). On the other hand, the guest-based provisioner
can still potentially execute "ansible" twice (once in the
AnsibleInstalled cap, and via "gather_ansible_version" function via
Base::set_compatibility_mode).
2017-09-06 17:12:40 +02:00
Gilles Cornu 8c0df3d046
provisioners/ansible: Move `version` to common options
Before this change, only the ansible_local provisioner supported this
option (for ansible version requirement, and pip installation). Now, the
ansible host-based provisioner can also require a exact ansible version.

Resolve #8914

Note: this has been added as part of #6570 resolution, since the
introduction of the `compatibility_mode` auto-detection made both
provisioners made capable to detect ansible version.

Pending: optimize the code to avoid duplicated executions of "ansible
--version" command.
2017-09-06 17:12:35 +02:00
Gilles Cornu a327e34861
provisioners/ansible: Validate compatibility_mode
- Use `'auto'` instead of `nil` for the auto-detection mode
- Add strict validation and related error message
2017-09-06 17:12:32 +02:00
Gilles Cornu 8834afbd8e
provisioners/ansible(both): Add compatibility mode
With this change, it is now possible to get rid of many deprecation
messages successively introduced in Ansible 1.9, and 2.0. More
interesting, the generated inventory will contain the recommended
variable names (e.g. `ansible_host` instead of `ansible_ssh_host`)
when the compatibility mode is set to '2.0'.

Details:

- Add `compatibility_mode` option to control the Ansible parameters
  format to be used. The value corresponds to the minimal version
  supported. For the moment, possible values are '1.8' (corresponding to
  Vagrant's former behaviour) or '2.0'.
  Note that a dynamic inventory generated in compatibility mode '2.0'
  is not supported by Ansible 1.x. On the other hand, Ansible 2.x so far
  supports inventory format generated by the compatibility mode '1.8'.

- Add compatibility mode auto-detection, based on the available Ansible
  version. This is the default behaviour in order to bring a maximum of
  user friendliness. The drawback of this approach is to let potential
  compatibility breaking risks, for `ansible` provisioner setups that
  already integrate Ansible 2.x **AND** rely on the existence of
  the generated `_ssh` variable names. Thanks to the vagrant warnings
  (and its release notes), I argue that it is worth to offer
  auto-detection by default, which offers a sweet transition to most
  users.

- Add `become`, `become_user` and `ask_become_pass` options and their
  backwards compatible aliases. The legacy options are now deprecated.

Note that we intentionally didn't provide a '1.9' compatibility mode,
as it would add extra-complexity for practically no added-value.
To my knowledge, the Ansible 2.x series haven't introduced yet any major
changes or deprecations that would motivate to introduce a higher
version compatibility mode (to be confirmed/verified).

Resolve GH-6570

Still Pending:

- Optimization: Reduce the number of `ansible` command executions.
  Currently two exec calls will be performed when the compatibility
  mode auto-detection is enabled (i.e. by default). We could make the
  provisioner a little bit smarter to only execute `ansible` only once
  in any situation (by combining "presence" and "version" checks).

- User-friendliness: Add better validator on `compatibility_mode`
  option, and shows a warning or an error instead of the silent
  fallback on the auto-detection modus.

- Test coverage: All the added behaviours are not fully covered yet.
2017-09-06 17:12:22 +02:00
Brian Cain f0f60a1075 (#4666) Remove duplicate export folders before writing /etc/exports
Prior to this commit, if you set up multiple folders to export with NFS
on linux with the exact same hostpath, the template used to write
/etc/exports would end up placing the same path with the same IP in
/etc/exports and cause an error preventing the folders from being
properly mounted. This commit fixes that by first looking at which
folders are being exported and if there are any duplicates. If so,
remove the duplicates and only export 1 hostpath folder. If these
duplicate folders have differing nfs linux options, an exception must be
thrown because we cannot assume which options the user intended to
export with.
2017-09-05 16:05:14 -07:00
Brian Cain 432cb8d915 (#7826) Add salt_arg option for passing flags to salt tool
This commit introduces the salt_arg option that allows a user to pass
additional command line flags to the `salt` tool when provisioning with
a master setup.

It also adds additional config validation to ensure that both
`salt_args` and `salt_call_args` is an array.
2017-08-29 14:11:06 -07:00
Chris Roberts f660c19084 Error when compose and force_host_vm are enabled together 2017-08-22 11:36:26 -07:00
Chris Roberts 4eb8d7a098 Merge pull request #8839 from chrisroberts/windows/req-min-ps
Validate powershell prior to powershell use
2017-08-21 13:48:08 -07:00
Brian Cain a2d39742a7 Merge pull request #8775 from lucky-sideburn/master
Added exception if chef.node_path is defined on Vagrantfile but the directory does not exist locally
2017-08-01 13:22:23 -07:00
Eugenio Marzo 7e436c6971 fixed warnings about missing folders for Chef Solo and Zero 2017-08-01 21:37:11 +02:00
Chris Roberts ad5bc23088 Validate powershell prior to powershell use
Adds powershell validation to ensure powershell is available on
the PATH and checks powershell version to ensure meets the
defined minimum powershell version.
2017-07-31 15:05:41 -07:00
Chris Roberts 3564b17925 Include plugin update option to vagrant upgrade error.
Fixes #8441
2017-07-26 15:04:44 -07:00
Eugenio Marzo c9b65bd129 produce error when node_path is defined but the directory does not exist on disk locally 2017-07-22 11:05:34 +02:00
Eugenio Marzo 94a94648dd change requested after a PR review 2017-07-22 07:58:38 +02:00
Eugenio Marzo dd3d782659 Added exception if chef.node_path is defined on Vagrantfile but the directory does not exist locally 2017-07-12 15:27:10 +02:00
Chris Roberts 7e4a34c323 Merge pull request #8761 from chrisroberts/communicator/win-ssh-tmp
WinSSH communicator updates
2017-07-07 11:46:53 -07:00
Chris Roberts cef38eefd0 Add public key capability to Windows guests for winssh communicator 2017-07-07 11:26:32 -07:00
Brian Cain b1548a2eb6 (#5160) Only rsync-auto current working dir with docker provider
Prior to this commit, when users invoked the `rsync-auto` command using
the docker provider with boot2docker, vagrant would rsync all known
containers using the boot2docker vm rather than the current working dir.
This commit updates that behavior to ensure that only the current
working dirs vagrant machines will be rsynced.
2017-07-06 15:05:42 -07:00
Brian Cain 0225d63055 Merge pull request #8722 from briancain/add-post-setup-proc-for-docker
Add post-install provisioner to docker provisioner
2017-06-28 08:32:23 -07:00
Chris Roberts d1a589c59f Merge pull request #8724 from chrisroberts/fix/windows-cwd-check
Set encoding when reading/writing cwd file
2017-06-27 19:21:16 -07:00
Brian Cain a05d95bd0a (#7139) Add post-install provisioner to docker provisioner
Prior to this commit, if a user attempted to configure
`/etc/default/docker` through vagrant prior to installation, the package
manager would not override an existing configuration and installing
docker would then fail. This commit fixes this by introducing a
`post_install_provisioner` that allows users to define a provisioner
block that will run after docker has been installed, allowing users to
configure `/etc/default/docker` how they want.
2017-06-27 16:01:23 -07:00
Chris Roberts eb9ed1b39e Update wording as machine rename is not always required 2017-06-27 13:36:42 -07:00
Chris Roberts 5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Brian Cain 378aae8782 Merge pull request #8653 from briancain/7188/master/unify-snapshot-restore-failures
Clean up vagrant snapshot restore/delete error messages
2017-06-07 11:47:38 -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
Fernando Seror 15871a481b Warn about changes to CWD on every machine action
Whenever the path where the machine was first created changes, Vagrant
will now show just one warning when an action is run on the machine.

The idea is that if a user copies the machine over to a different
directory with the idea of running two different machines, this warning
will now help the user determine how to make that work.
2017-06-05 13:25:30 -07:00
Brian Cain 875aee3636 Merge pull request #8632 from gtbono/fix_typo_link
Fixes typo in broken link to documentation
2017-06-01 09:08:11 -07:00
Brian Cain d0f1f39fa6 Merge pull request #8636 from briancain/7118/master/handle-invalid-box-names
Handle box names that are URLs
2017-05-31 16:16:38 -07:00
Brian Cain f1d08aa629 (#7118) Handle box names that are URLs
Prior to this commit, if a user set a URL for the name of a box, vagrant
would not warn the user about using box_url instead. This would lead to
some difficult user experiences around the various box commands due to
the box name being a full URL. This commit introduces a warning to the
user and lets them know to instead use box_url.
2017-05-31 15:25:05 -07:00
Giovanni Tempobono 68b01d4288 Fixes typo in broken link to documentation 2017-05-31 14:40:06 +00: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 36ecd40c52 Support optional detach and pass blocks through to execution. 2017-05-12 15:09:30 -07:00
Chris Roberts ed8378bcf5 Add output for incorrect type on compose_configuration option 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 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 e8e38a4007 Halt Vagrant if within WSL and attempting to operate out of rootfs 2017-05-08 15:21:39 -07:00
Chris Roberts 4df4f77bf6 Match WSL installed Vagrant with Windows installed Vagrant 2017-05-08 10:21:01 -07:00
Chris Roberts 83b0c87f52 Support running Vagrant within the Windows Subsystem for Linux 2017-05-08 10:21:01 -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 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
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 df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07: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 f48b363093 Merge pull request #8089 from jopi2016/master
enhance untar_failure message
2017-03-06 09:05:25 -08:00
Chris Roberts e2acb5250a Add command deprecation helper module 2017-02-24 06:22:39 -08:00
Hasyimi Bahrudin cbda9f0906 Add validate command for validating Vagrantfile 2017-02-07 13:43:49 +08:00
mammele 14e6405792 enhance untar_failure message 2016-12-06 16:44:47 +01:00
Chris Roberts 0cba6bf535 Expand on plugin repair failure output 2016-11-28 07:48:16 -08:00
Chris Roberts 53b9f1747c Allow plugin_init_error to provide all information. Include final reset on specifications. 2016-11-17 16:40:51 -08:00
Chris Roberts e2d96f942f Provide nice error output when plugin initialization fails
Include extra logging during initialization to display error if encountered
and solution set prior to performing activations.
2016-11-15 15:50:39 -08:00
Chris Roberts 0f720a4386 Merge pull request #7985 from chrisroberts/shell-provisioner/checksum
Add md5 and sha1 checksum support to Downloader.
2016-11-14 13:19:22 -08:00
Chris Roberts beffa70941 Downloader checksum output information and digester usage
Add more output information around type of checksum being validated.
Use builtin Digest#file to read target file for generation of hexdigest.
2016-11-14 10:22:25 -08:00
Chris Roberts da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00
Chris Roberts f045f74d86 Only proceed if confirmation is matched. Do not continue if user aborted. 2016-11-07 19:25:32 -08:00
Chris Roberts b15ef3a6ff Add plugin expunge command to remove all user installed plugins 2016-11-07 18:48:51 -08:00
Chris Roberts 5d68c8c30b Include plugin repair command 2016-11-07 18:48:51 -08:00
Chris Roberts d1a778dbfb Include error handling when subprocess commands fail 2016-10-31 07:42:30 -07:00
Chris Roberts c39b3fbb76 guests/openbsd: Check package installation after installing package
The `pkg_add` command will return `0` when a package requested for
installation is not found. This adds a validation check to ensure
the rsync package is actually installed on the guest.
2016-10-25 12:16:52 -07:00
Chris Roberts 4ddc9b0804 Merge pull request #7674 from voxik/fix-permissions
Remove executable permissions.
2016-10-06 16:25:53 -07:00
Chris Roberts bbac718925 Add NFSv4 warning and information 2016-08-19 09:33:36 -07:00
Vít Ondruch ed0641e295 Remove executable permissions.
Introduced in 37940e735.
2016-08-03 14:34:52 +02:00
Seth Vargo 7a4fb236bb
Fix typo
Fixes GH-7633
2016-07-24 21:18:16 -04:00
Seth Vargo 3b2ffae400
guests/bsd: Print a very descriptive error when mounting vbox folders
BSD-based guests do not support VirtualBox shared folders. This is a
common source of confusion in Vagrant. This new error clearly explains
that this is not a bug in Vagrant and provides instructions on how to 
disable them.
2016-07-18 21:12:58 -04:00
Seth Vargo 7e88266999
guests/linux: Properly escape and retry vbox shared folder mounting 2016-07-18 21:12:57 -04:00
Seth Vargo 177b7784dd
guests/darwin: Allow ipv6 static networks 2016-06-19 12:01:52 -04:00