Commit Graph

1123 Commits

Author SHA1 Message Date
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
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