Commit Graph

2370 Commits

Author SHA1 Message Date
Chris Roberts a8b2f78f59 Do not prefix Windows paths if UNC prefix already exists
While VirtualBox has commented that they do not support UNC remote
paths (but do for long paths) it seems that remote paths can work.
If user provides UNC path, allow it to be used as-is.

Fixes #7011
2017-04-20 16:33:38 -07:00
Chris Roberts 82ca8f8058 Support port checker methods which only accept the host port
When calling the port_checker an arity check is done to determine
if the helper accepts the host_ip and host_port or only the host_port.

Fixes #8423
2017-04-19 10:49:27 -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 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 c56acfab94 Add WinSSH communicator 2017-04-15 07:12:58 -07:00
Martin Nowak 1ca247f516 fix `config.ssh.keys_only = false` for ansible
Also see #5017.
2017-04-12 12:31:00 +02: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
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
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 052ff53642 Merge pull request #8399 from chrisroberts/fix/port-check
Use 127.0.0.1 for host IP when unset and 0.0.0.0 is not available
2017-03-23 09:37:33 -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
Chris Roberts 21b7214668 Merge pull request #8336 from chrisroberts/networking/overhaul
Remove hardcoded interface name from template
2017-03-23 09:10:01 -07:00
Chris Roberts 5cd95b684f Use 127.0.0.1 for host IP when unset and 0.0.0.0 is not available 2017-03-22 16:31:46 -07: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 99942f888f Merge pull request #8366 from chrisroberts/fix/never-provision
Fix provision action for provisioners set to never.
2017-03-17 14:31:03 -07:00
Chris Roberts 7be5266e20 Add spec support scripts for centos 2017-03-17 14:18:14 -07:00
Chris Roberts e7ecfa8109 Use guest boxes variable, not constant. Remove option value quotes. 2017-03-15 11:02:31 -07:00
Chris Roberts ce2a1ac634 Adjustable host memory. Allow custom command arguments. 2017-03-15 09:30:57 -07:00
Chris Roberts eed7b859ca Fix provision action for provisioners set to never.
This updates the behavior of the provision action to never run a provisioner
that is specified to "never" run unless it has been explicitly requested. Also
adds test coverage to the provision action.
2017-03-13 13:53:31 -07:00
Chris Roberts dcdcf3f013 Add entry point for running vagrant-spec 2017-03-09 16:05:34 -08:00
Chris Roberts e09077ee33 Add box from local path and use generic name 2017-03-09 12:44:10 -08:00
Chris Roberts b66446712c Start adding test coverage on port collision handling action 2017-03-09 10:28:41 -08:00
Chris Roberts 9d1ec938ef Merge pull request #8341 from chrisroberts/enhancement/prerelease
Support spec prerelease matching
2017-03-07 15:02:17 -08:00
Chris Roberts c03ca851b1 Merge pull request #8327 from chrisroberts/plugins/local-path
Force path as preferred source on local install
2017-03-07 15:00:39 -08:00
Chris Roberts abf38106c0 Add shared helper method to detect if running version is prerelease 2017-03-07 10:36:14 -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 d862133038 Remove hardcoded interface name from template 2017-03-06 14:18:26 -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 68be1422f8 Add test coverage for box sorting
Provides test coverage for proper box sorting using BoxCollection#all
and BoxCollection#find.
2017-03-06 08:19:49 -08:00
Chris Roberts 8a9fa302f0 Removing timing issues from test coverage 2017-03-03 09:49:55 -08:00
Tobias d074ac7906 guests/esxi: Added public_key_test 2017-02-28 08:22:05 -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 e2acb5250a Add command deprecation helper module 2017-02-24 06:22:39 -08:00
Chris Roberts ccdccf06b5 Merge pull request #8194 from chrisroberts/fix/curl-credentials
Scrub credentials from box URLs
2017-02-23 13:51:47 -08:00
Chris Roberts 74438cc495 Merge pull request #8196 from chrisroberts/fix/expand-vagrantfile-path
Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
2017-02-23 13:33:07 -08:00
Chris Roberts 578c38e336 Update box add commands in acceptance tests 2017-02-23 10:12:17 -08:00
Chris Roberts 9394679cb7 Add coverage on box version in minimal init 2017-02-22 12:31:24 -08:00
Chris Roberts 64fd2f71d6 communicator/ssh: discard stderr data before command run 2017-02-16 15:43:04 -08:00
Chris Roberts 088829de9b Merge pull request #8270 from chrisroberts/enhancement/process-stop
Add new methods to Subprocess
2017-02-16 13:45:25 -08:00
Chris Roberts 0627e33652 Include test coverage on generated arch net config command 2017-02-09 17:41:44 -08:00
Chris Roberts e7e24ee853 Merge pull request #8248 from chrisroberts/fix/env-gems-path
Fix environment gems_path location
2017-02-08 14:18:41 -08:00
Chris Roberts 903428e569 Add Util::Subprocess#stop and Util::Subprocess#running? 2017-02-08 14:15:47 -08:00
Hasyimi Bahrudin 3d089a62d1 Add unit test for validate command 2017-02-07 14:59:20 +08:00
Chris Roberts 959bdada82 Fix environment gems_path location 2017-02-01 12:43:16 -08:00
Chris Roberts 25a2bdd279 Prevent generating environment variables with invalid empty names 2017-01-12 15:12:41 -08:00
Chris Roberts 832c62f2aa Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
This allows custom paths that include special characters like `~`
to be properly expanded instead of resulting in joined root path
with special characters included.
2017-01-12 14:01:25 -08:00
Chris Roberts a055978d74 Scrub credentials from box URLs 2017-01-12 13:24:46 -08:00
Chris Roberts c11534e13c Merge pull request #8102 from mwrock/winrmv2
Refactor winrm communicator to use latest winrm gems and v2 api
2017-01-05 10:48:44 -08:00
Gilles Cornu 9493901e0c
provisioners/ansible: Add example of `host_vars` values that include quotes
Motivated by the support effort on GH-8158 ;-)
2016-12-28 23:23:43 +01:00
Chris Roberts 9f393fc1e0 Use uid/gid from mount_options if provided for synced folders.
This also extracts the gid/uid detection and upstart actions into
reusable module to provide consistent behavior.
2016-12-14 12:12:17 -08:00
Matt Wrock 725824e1dd refactor winrm communicator to use latest winrm gems and v2 api
Signed-off-by: Matt Wrock <matt@mattwrock.com>
2016-12-11 00:52:00 -08:00
Bryce Shurts e4626d088d issue-7983 - Helper now throws WinRMNotReady exception is host ip is reported as an empty string 2016-12-01 13:03:38 -06:00
Chris Roberts cf93efca2d Update tests for new information and cleaning method 2016-11-16 13:27:34 -08:00
Gilles Cornu 8caed8ea16 Merge pull request #7918 from mitchellh/gildegoma/fix-7195
Add `config_file` option to both Ansible provisioners
2016-11-15 08:29:30 +01:00
Chris Roberts ac74774fcb Merge pull request #8000 from chrisroberts/plugins/updates
Plugin handling updates
2016-11-14 13:24:52 -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 214f3ccee7 Merge pull request #7989 from chrisroberts/fix/more-networking-sorting
Only match interfaces without special characters
2016-11-14 13:17:19 -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
Gilles Cornu 1de9f2228d
provisioners/ansible: Fix a mistake in a unit test 2016-11-13 21:00:58 +01:00
Chris Roberts 3afa7a3193 Update specs to match updated behavior for local install 2016-11-11 15:21:30 -08:00
Chris Roberts 5482692127 guests/linux: Only match interfaces without special characters 2016-11-10 07:19:26 -08:00
Chris Roberts f6a0861c40 Add stub test for salt provisioner 2016-11-09 16:29:23 -08:00
Chris Roberts 2d6071a55b Merge pull request #7793 from chrisroberts/enhancement/bundler-less
[core] Remove bundler usage for plugin management
2016-11-09 16:17:47 -08:00
Chris Roberts 2dcb47410f Merge pull request #7976 from chrisroberts/ssh/shell-compat
Allow custom generation of environment variable exports
2016-11-09 16:14:33 -08:00
Chris Roberts 8d2d324b13 Merge pull request #7980 from chrisroberts/synced-folder/auto-mount
Named synced folders
2016-11-09 16:12:03 -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
Björn Brala cdc5018b59 Add tests for prune command 2016-11-09 09:24:41 +01:00
Chris Roberts d528902edc Make guestpath an optional parameter for synced_folders 2016-11-08 15:33:30 -08:00
Chris Roberts dfc5e0d9a0 communicator/ssh: Allow custom generation of environment variable exports 2016-11-08 09:50:39 -08:00
Chris Roberts 1f5dd35d16 Remove bundler where no longer required 2016-11-07 20:00:38 -08:00
Chris Roberts 36d21f3c3f Add testing for plugin expunge command 2016-11-07 19:26:33 -08:00
Chris Roberts dbbd2d8e36 Remove deprecated methods and update tests. 2016-11-07 18:48:14 -08:00
Chris Roberts d1a778dbfb Include error handling when subprocess commands fail 2016-10-31 07:42:30 -07:00
Chris Roberts d89924afef Include test coverage on linux host nfs plugin 2016-10-29 17:54:41 -07:00
Chris Roberts dd7294b021 Merge pull request #7928 from chrisroberts/rsync/exclude-paths
synced_folders/rsync: Quote exclude paths
2016-10-26 07:16:15 -07:00
Chris Roberts be3fa85853 Merge pull request #7921 from chrisroberts/fix/key-fixups
Remove `set -e` usage for better shell compatibility
2016-10-25 14:43:04 -07:00
Chris Roberts 365b98fee6 Merge pull request #7926 from chrisroberts/networking/rhel
guests/redhat: Force NetworkManager to reload device configurations
2016-10-25 14:41:07 -07:00
Chris Roberts 05c5aab92a synced_folders/rsync: Escape exclude paths 2016-10-25 13:59:03 -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 67f3c8b48c guests/redhat: Force NetworkManager to reload device configurations
When configuring network devices force NetworkManager to reload new
configuration files as they appear. This prevents NetworkManager from
attempting to continue managing devices on initial start up.
2016-10-25 07:45:38 -07:00
Chris Roberts fb4e4320b2 Remove `set -e` usage for better shell compatibility 2016-10-24 10:30:08 -07:00
Gilles Cornu a842abbc38
provisioners/ansible(both): Add config_file option
With this new option defined, the `ansible-galaxy` and
`ansible-playbook` commands generated by the Ansible provisioners will
be executed with the ANSIBLE_CONFIG environment variable set
accordingly.

Resolve GH-7195

This commit also fix the following open issues:
- Implement the pending RSpec examples about path existence checks
  performed by the ansible (remote) provisioner.
- In verbose mode, the ansible remote provisioner now correctly displays
  the Ansible Galaxy parameters ("role_file" and "roles_path") with
  single quotes (which is safer for potential copy-paste usage).

Additional Notes:
- Test coverage for `ansible_local` provisioner is still not
  implemented. See GH-6633.
- Test coverage for galaxy from host is not implemented yet (due to
  general issue with mocking both command executions, see
  https://github.com/mitchellh/vagrant/pull/6529#r45278451
2016-10-22 01:09:12 +02:00
Gilles Cornu b1ddc98e17
Merge pull request #7881 (Add playbook_command option)
Note that error messages were not adapted, and only mention
a generic "Ansible Software" when executed commands are failing.
We assume that people using the `playbook_command` option are
advanced users that will know all the components to be considered.
2016-10-10 23:18:24 +02:00
Chris Roberts 07ce1c6930 Merge pull request #7866 from chrisroberts/guest-linux/network-interfaces-sorting
guests/linux: Update network interface sorting implementation
2016-10-10 10:59:52 -07:00
Chris Roberts 7eb1091a71 Merge pull request #7874 from chrisroberts/enhancement/cast-box-version
config/vm: cast box version to string before string operations
2016-10-10 10:57:53 -07:00
Chris Roberts a8970281ce guests/linux: Properly sort interface name types
Add failing networking interface list sorting test with example
provided by #7883. Update sorting logic to properly handle different
types and differing array lengths.

Fixes #7883
2016-10-10 10:22:19 -07:00
Daniel Gonzalez 79a3cb8a14 Add unit test and documentation for playbook_command option 2016-10-10 16:56:36 +02:00
Daniel Gonzalez 58f2b0c8c7 Make ansible-playbook command configurable
The ansible-playbook command is currently hardcoded for the ansible and
ansible_local provisioners. This patch adds the config option
playbook_command to allow the user to change the command.
2016-10-09 20:48:50 +02:00
Chris Roberts 28f2ed56cf Merge pull request #7756 from alexoj/master
Fix Vagrant not prioritizing configured providers correctly
2016-10-07 17:14:54 -07:00
Mark Peek 4bf32e3f6d Fix typo (netmast => netmask) for Photon guest #7808 2016-10-07 12:32:21 -07:00
Chris Roberts 26b3a303d2 config/vm: cast box version to string before string operations 2016-10-06 16:16:59 -07:00