Commit Graph

1223 Commits

Author SHA1 Message Date
Brian Cain f4d618eb58
Fixes #9840: Introduce `ruby` option for trigger
This commit introduces a new option to the core trigger feature: `ruby`.
It can be defined to run ruby code when the trigger is configured to
fire. If you give the ruby block an env and machine argument, the
defined ruby code can use those variables internally.
2018-10-05 12:53:41 -07:00
Chris Roberts 904a712838 Provide correct RDP information within configuration information
Dynamically generate RDP information when applicable via provider
if supported. When no RDP port is provided ignore RDP in config
and omit from output.
2018-10-04 14:41:10 -07:00
Chris Roberts 48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Chris Roberts 85dc0ebec9 Allow automatic mac address assignment with virtuabox provider 2018-10-01 11:05:28 -07:00
Brian Cain 58ebd52f99
Add abort option to core triggers
This commit adds a new option `abort`, which when configured, will exit
the Vagrant process completely. If set to `true`, it will exit cleanly
with exit code 0. Otherwise, the exit code can be configured.
2018-09-25 09:40:36 -07:00
Brian Cain 4612619dc4
Fixup docker config update 2018-09-19 10:52:59 -07:00
Oleksiy Protas 166fe374b6
More explicit logging and 'dockerfile' option support 2018-09-19 10:25:37 -07:00
Oleksiy Protas de6a1794c7
Config, validation and test 2018-09-19 10:24:09 -07:00
Oleksiy Protas 8d1b5fc1c9
Docu changes for building Docker images from git 2018-09-19 10:24:05 -07:00
Chris Roberts 798fb81926 Force command to be re-run after installing local plugins
Reloading the Vagrantfile causes issue with multiple evaluations
where users expect single evaluation. Instead of allowing local
plugin installation to happen prior to command execution, force
halt after installation and the command to be re-run. This will
prevent multiple loads of the Vagrantfile within a single run.
2018-09-10 09:59:58 -07:00
Chris Roberts 147b5c653e Check verify_host_key for falsey or :never values when generating ssh config 2018-09-05 13:44:07 -07:00
Tino Breddin 5e642a513f Add IPv6 network template for OpenBSD machines 2018-08-13 16:51:57 +02:00
Chris Roberts a993cbce4e
Merge pull request #10037 from chrisroberts/e-vagrant-plugins-local
Define project specific plugins
2018-07-27 09:57:41 -07:00
Chris Roberts 27a441f0bd
Merge pull request #10001 from chrisroberts/e-wsl-valid-sync
Disable synced folders on non-DrvFs
2018-07-18 16:41:16 -07:00
Chris Roberts 8e0e2fc53a Add output for local repair 2018-07-18 15:49:30 -07:00
Chris Roberts 40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Brian Cain 52c3dcc70e
(#9997) Catch and allow for non-standard exit codes
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
2018-07-09 15:56:26 -07:00
Chris Roberts 859d48d5f5 Restrict synced folder access to DrvFs file systems only within WSL 2018-07-06 16:58:12 -07:00
Koen Verheyen 614570fd89 Typo in en.yml 2018-06-29 16:44:43 +02:00
Koen Verheyen 7939784d1b Display current version in version check 2018-06-29 16:41:50 +02:00
Chris Roberts 101fc447ec Add Hyper-V access check on data directory 2018-06-18 15:36:45 -07:00
Chris Roberts 07c5fd4885 Fix SMB error message to be within the correct namespace 2018-06-18 09:07:30 -07:00
Chris Roberts 73c09de1a9 Add deprecation warning when `differencing_disk` option is used 2018-05-29 10:21:06 -07:00
Chris Roberts b1f0f1566d Add new entries for hyper-v config validation errors 2018-05-24 16:56:18 -07:00
Aleksi Aalto fa272816ff global status informs about --prune
It's not obvious from the old explanation, how to get
rid of get rid of data that "may not be completely
up-to-date".
2018-05-22 15:20:40 +03:00
Brian Cain 5ca382727d
Raise error if argument is provided with `--all-global` flag
This commit raises an error if additional arguments are provided to the
suspend command when the `--all-global` flag is used.
2018-05-11 15:43:14 -07:00
Chris Yungmann 7fb9d3eb4f propagate unset guestpath 2018-05-08 22:51:30 -05:00
Chris Roberts 02b9d625d3
Merge pull request #9759 from StefanScherer/wsl-remove-raise-vboxmanage-missing
Allow other providers in WSL
2018-05-03 12:42:16 -07:00
Brian Cain beb08b51a4
(#7076) Continue on if vagrant fails to parse metadata box for update
Prior to this commit, vagrant would halt if it could not parse the
metadata file for a box to check for updates with. This commit changes
that to behave like when vagrant fails to download a metadata file and
continue on but warn the user it failed to check for box updates.
2018-05-02 13:58:21 -07:00
Stefan Scherer f14e8bcbf2
Allow other providers in WSL 2018-05-02 22:36:17 +02:00
Brian Cain fd3d78746c
(#9717) Improve messaging around not finding requested provider
This commit adds a bit more helpful messaging for the user when asking
for a provider that might not exist or does not follow the correct
casing. If it can find a match on a provider it knows about, it will
suggest it.
2018-04-26 09:43:58 -07:00
Brian Cain a1ca29c5e4
Add warn and info validation translation strings 2018-04-20 10:51:38 -07:00
Brian Cain e25cb51f15
Properly print warnings on config settings that aren't supported 2018-04-20 10:51:38 -07:00
Brian Cain 12b1a3dfe4
Update triggers based on code review 2018-04-20 10:51:38 -07:00
Brian Cain 0054c5aae6
Raise error if incomplete trigger block is defined 2018-04-20 10:51:38 -07:00
Brian Cain 693eb2fbbb
Add machine level warning when privileged option is set for run 2018-04-20 10:51:38 -07:00
Brian Cain 3ad4f576c0
Add only_on validation for config 2018-04-20 10:51:38 -07:00
Brian Cain 600557ff24
Move strings to translation file 2018-04-20 10:51:38 -07:00
Brian Cain 1591ae9916
Make run and run_remote settings shell provisioner configs 2018-04-20 10:51:38 -07:00
Brian Cain 60ff2489c4
Display warning if vagrant command for trigger is not found 2018-04-20 10:51:38 -07:00
Brian Cain 8e72ae5bd6
Add basic validation for trigger config objects 2018-04-20 10:51:38 -07:00
Brian Cain 4db3d49157
Improve network collision error message
This commit provides a bit more information when a non-hostonly network
collides with a host network.
2018-04-12 14:16:13 -07:00
Chris Roberts f3c5e86f28
Merge pull request #9504 from zachflower/feature/vagrant-aliases
Vagrant aliases
2018-04-06 15:39:18 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Brian Cain 94d9495209
Merge pull request #9543 from moore3071/unnecessary_redirects
Update URLs for the repo
2018-03-08 09:54:16 -08:00
Brandon Moore 5a12641f9c
Update URLs for the repo 2018-03-07 17:10:30 -05:00
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
Chris Roberts 04ec3c26d7
Merge pull request #8735 from jhosteny/fix/debian_net_tools_deprecation_dhcp
Fix #8730. Use 'ip route' in lieu of 'route' in debian dhcp template
2018-02-23 09:41:37 -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 78f317f55a
Merge pull request #9261 from vStone/bugfix/gentoo-static-ip-with-ifplugd
Disable if/netplugd when setting up a static ip on a gentoo guest using openrc.
2018-02-15 13:13:46 -08: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
Jan Vansteenkiste e5bebb0b9f
Disable (if/net)plugd on gentoo/openrc. Fixes #9260.
When ifplugd is installed, the process is backgrounded and we get the
wrong return value.
2017-12-14 06:02:28 +01: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 2451c859e8 Merge pull request #8746 from mastersin/alt
Add ALT Linux platforms guest detection and network configuration support (#8745)
2017-09-06 17:49:38 -07: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