Commit Graph

2588 Commits

Author SHA1 Message Date
Gilles Cornu a3c077cbe0 Merge branch 'gildegoma/ansible-force-ssh-user'
Resolved conflicts in
  plugins/provisioners/ansible/config.rb
  plugins/provisioners/ansible/provisioner.rb
  test/unit/plugins/provisioners/ansible/provisioner_test.rb
  website/docs/source/v2/provisioning/ansible.html.md

ref #6348
2015-11-08 14:01:23 +01:00
Gilles Cornu 9bfdaf7e75 provisioners/ansible: introduce ansible_local
With this change, the existing host-based Ansible provisioner is
refactored to share a maximum of code with this new guest-based Ansible
provisioner.

At this stage of development, the existing unit tests are intentionally
modified as little as possible, to keep safe the existing funtionalities.

Other issues resolved by this changeset:
 - Display a warning when running from a Windows host [GH-5292]
 - Do not run `ansible-playbook` in verbose mode when the `verbose` option
   is set to an empty string.
2015-11-08 10:42:48 +01:00
Mitchell Hashimoto baea923e9c commands/up: automatically install providers 2015-11-05 13:58:15 -08:00
Luca Invernizzi df32f6ac51 Update docker installer to work on custom kernels
The current docker installer attempt to install the linux-image-extra-`uname -r` DEB package on Debian systems.
This package may not exist, for example on custom kernels (e.g., Linode servers).
If this happens, Vagrant halts the provisioning. However, this package is not really needed in newer Debian releases (such as Ubuntu 14.04).

This small patch checks if the linux-image-extra-`uname -r` package exists, and it will install it if it does. In either case, it will continue provisioning.
2015-11-05 13:56:13 -08:00
Clayton O'Neill d863242538 Add Errno::ENETUNREACH to SSH rescue
This changes the ssh ready? method to treat ENETUNREACH the same way as
EHOSTUNREACH errors.

When attempting to SSH into a box, it tries up to 5 times to connect to
the box, ignoring various errors.  Later it will catch and gracefully
handle most of those errors so that callers don't have to know the
details.

However, the Errno::ENETUNREACH error is not caught, which means that
callers that expect a clean boolean return from ready? don't get that,
and instead get an exception they probably aren't expecting.
2015-11-05 15:40:27 -05:00
Indrek Ardel 4a7aa83e58 Use UNC paths for shared folders on Windows host 2015-11-05 18:56:24 +02:00
Indrek Ardel ea66e22d2e Use UNC paths for shared folders on Windows host 2015-11-05 18:55:34 +02:00
Mitchell Hashimoto abb1030f10 hosts/windows: install VirtualBox 2015-11-04 19:37:55 -08:00
Mitchell Hashimoto dad5962ebb hosts/darwin: support virtualbox install 2015-11-04 15:47:56 -08:00
Mitchell Hashimoto 72e13ee9ef test: add tests for provider command 2015-11-04 14:26:22 -08:00
Mitchell Hashimoto d4ddb3c2f3 commands/provider 2015-11-04 14:20:48 -08:00
Eric Winkelmann e687f81fce Re-word Linux RDP error to include `xfreerdp`.
Changed the name of the error LinuxRDesktopNotFound to
LinuxRDPClientNotFound and re-worded error text in
templates/locales/en.yml to include `xfreerdp` when listing supported
RDP clients.
2015-11-02 23:42:01 -08:00
Eric Winkelmann 879977832c Prefer xfreerdp for RDP connections on Linux hosts.
Rather than only using rdesktop (which does not work properly with newer
versions of RDP), use xfreerdp if available and fall back to rdesktop if
not.
2015-11-02 23:39:06 -08:00
Aneesh Agrawal 84408c1682 Enable log_level and colorize for salt masterless 2015-11-02 20:57:29 -05:00
Gilles Cornu dde94a3ce7 provisioners/ansible: add force_remote_user option
The benefits of the following "breaking change" are the following:
- default behaviour naturally fits with most common usage (i.e. always
  connect with Vagrant SSH settings)
- the autogenerated inventory is more consistent by providing both the
  SSH username and private key.
- no longer needed to explain how to override Ansible `remote_user` parameters

Important: With the `force_remote_user` option, people still can fall
back to the former behavior (prior to Vagrant 1.8.0), which means that
Vagrant integration capabilities are still quite open and flexible.
2015-11-02 09:03:15 +01:00
matthewcodes 8e7a297fb5 Fix for interpolated strings being used for username and passwords, this fix was made in commit 1dd081d but was removed by 1152b4e. This was causing passwords with $ in them to stop working as the dollar sign was getting stripped out 2015-10-28 16:39:19 +00:00
Mitchell Hashimoto efa01abb12 providers/virtualbox: if no box, don't import the master 2015-10-16 10:30:04 -07:00
Timotei Dolean 13be9731ab Remove back tick in puppet facts definitions #6403
Starting with vagrant 1.7.3 
(commit 1152b4e1df) we don't
save the command to be executed in the file anymore, but we send
it as a parameter, thus the back tick makes things worse.
2015-10-16 16:20:15 +03:00
Dan Dunckel aec65b5d66 Fix user to username that was lost in merge conflict resolution 2015-10-15 12:41:08 -07:00
Dan Dunckel d859a3b752 Somehow I missed this param while resolving conflicts 2015-10-15 12:36:19 -07:00
Dan Dunckel 9d87be51da Small refactor on conditional check and add tests 2015-10-15 12:25:50 -07:00
Marc Siegfriedt 8e87990599 add the option to make elevated interactive scripts 2015-10-15 12:25:50 -07:00
Seth Vargo c88d52082a Merge pull request #6296 from tomfanning/master
Hyper-V set mac address
2015-10-14 13:02:53 -04:00
Mitchell Hashimoto 5e48d35911 Merge pull request #6229 from mitchellh/b-winrm-info-respect-timeout
communicators/winrm: respect boot_timeout when fetching winrm_info
2015-10-12 15:50:05 -04:00
Tadej Janež 29e60882ca Fixes Fedora network issues when biosdevname command is not present.
Previously, configuring and enabling network interfaces failed with:

"The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/usr/sbin/biosdevname --policy=all_ethN -i bash: /usr/sbin/biosdevname:
No such file or directory

Stdout from the command:

bash: /usr/sbin/biosdevname: No such file or directory"

The previous attempt to fix this (ccc4162) doesn't work since it doesn't
properly parse the 'bash: /usr/sbin/biosdevname: No such file or
directory' error message.

This patch works around that problem and adds a comment explaining the
meaning of the return codes.
2015-10-11 23:10:26 +02:00
Johannes Graf 9998544995 Fix for #6151 / provisioner puppet_server with Puppet Collection 1
puppet_server provisioner fails with Puppet Collection 1 with the
following error:

```bash
==> default: Running provisioner: puppet_server...
The `puppet` binary appears not to be in the PATH of the guest. This
could be because the PATH is not properly setup or perhaps Puppet is not
installed on this guest. Puppet provisioning can not continue without
Puppet properly installed.
```
2015-10-10 21:16:12 +02:00
Mikhail Zholobov f930fa94af Move "cant_read_mac_addresses" error to the global space
Now it is used not only by Windows, but by Darwin guests as well.
2015-10-09 14:57:41 +03:00
Mikhail Zholobov e426455309 guests/darwin: Configure network following the MAC addresses matching
Currently `configure_networks` guest cap configures NICs following the device order and fails
when the device order is mixed. We should detect the appropriate NIC by its MAC address.
2015-10-09 14:57:41 +03:00
Mitchell Hashimoto 36cfc77167 providers/virtualbox: make prepare clone a core thing 2015-10-08 16:02:37 -04:00
Jurnell Cockhren 86e56aeac3 Revert "Salt Provisioner: Added a 'custom' option to install_type to allow more flexibility in passing arguments to the bootstrap script. Updated the docs."
This reverts commit 0289ab986c.

Refers to issues #6276, #5973, #5936 and #5435

Conflicts:
	website/docs/source/v2/provisioning/salt.html.md
2015-10-08 15:01:00 -05:00
Jurnell Cockhren 1a7c6dcfeb Revert "Salt Provisioner: refactor custom install_type option to add install_command instead"
Refers to issues #6276, #5973, #5936 and #5435

This reverts commit 72e63767ac.

Conflicts:
	website/docs/source/v2/provisioning/salt.html.md
2015-10-08 15:01:00 -05:00
Jurnell Cockhren fb611c7389 Revert "Initialize the install_command salt config var"
Refers to issues #6276, #5973 and #5936

This reverts commit ccd7354665.
2015-10-08 15:01:00 -05:00
Jurnell Cockhren 70e9079449 Revert "Fix alignment of initializer"
Refers to issues #6276, #5973 and #5936

This reverts commit 27d7518636.
2015-10-08 15:01:00 -05:00
Mitchell Hashimoto 5ea24e39d0 providers/virtualbox: unify import/clone 2015-10-08 13:07:05 -04:00
Mitchell Hashimoto 4908cd9cd9 providers/virtualbox: copy SSH key 2015-10-08 12:58:06 -04:00
Mitchell Hashimoto e9922d1754 providers/virtualbox: discard state if cloning 2015-10-08 12:50:02 -04:00
Mitchell Hashimoto dbcc936a71 kernel/v2: box is optional if clone is set 2015-10-08 12:41:16 -04:00
Mitchell Hashimoto f0ddac8c9a providers/virtualbox: clone 2015-10-08 12:33:55 -04:00
Mitchell Hashimoto c5c3ba616b providers/virtualbox: some progress 2015-10-08 12:09:46 -04:00
Mitchell Hashimoto 9f05d22eb0 providers/virtualbox: cloning can do a non-linked clone 2015-10-08 12:03:58 -04:00
Mitchell Hashimoto 20310dce0c noop 2015-10-08 11:59:30 -04:00
Mitchell Hashimoto 06f8595bc0 kernel/v2: clone option 2015-10-08 11:59:09 -04:00
Mitchell Hashimoto 44d484e2e0 providers/virtualbox: ability to customize linked clone snapshot 2015-10-08 11:58:47 -04:00
Mitchell Hashimoto ec0326f1c8 Merge pull request #6377 from mitchellh/f-cap-command
"cap" command
2015-10-08 10:52:14 -04:00
Mitchell Hashimoto 50638b2e55 commands/cap: require_relative 2015-10-08 10:42:10 -04:00
Mitchell Hashimoto 0a52e06298 commands/snapshot: use require relative 2015-10-08 10:40:46 -04:00
Mitchell Hashimoto 0b2d60ac39 commands/cap: better help 2015-10-08 10:36:44 -04:00
Mitchell Hashimoto 99d29f17fa commands/cap 2015-10-08 10:35:36 -04:00
Mitchell Hashimoto 6e187aaefb providers/virtualbox: v4.2 and 4.3 support 2015-10-08 08:57:21 -04:00
Mitchell Hashimoto 0abc17eaed commands/snapshot: push now uses caps to be more resilient 2015-10-08 08:55:13 -04:00
Mitchell Hashimoto 7480b65e9d providers/virtualbox: use caps for snapshot list 2015-10-08 08:46:36 -04:00
Mitchell Hashimoto ed4df21c85 commands/snapshot: push and pop 2015-10-07 22:52:27 -04:00
Mitchell Hashimoto c36b682e40 providers/virtualbox: fix error if no snapshots 2015-10-07 22:22:55 -04:00
caleblloyd 00894b5a27 hyper-v boot device by generation fixes #6372 2015-10-07 20:25:09 -04:00
Mitchell Hashimoto 8c0e38b397 providers/virtualbox: snapshot restore 2015-10-07 16:48:29 -04:00
Mitchell Hashimoto c635352b89 providers/virtualbox: list snapshots, progress for delete 2015-10-07 16:41:58 -04:00
Mitchell Hashimoto d0e8ecfc73 providers/virtualbox: snapshot save/delete 2015-10-07 16:16:53 -04:00
Mitchell Hashimoto a99ebcb3ce commands/snapshot 2015-10-07 15:52:37 -04:00
Guillermo Bonvehí 07e38f1bb3 Fix Slackware Host detection and nfsd checks
Slackware's version file is /etc/slackware-version not
/etc/slackware-release.
pidof is not on PATH by default (not running as root) so call it using
full path
2015-10-07 01:17:07 -03:00
Mitchell Hashimoto 0586412f9d providers/virtualbox: fix some crashing bugs 2015-10-06 16:22:48 -04:00
Mitchell Hashimoto 2c936b2e37 providers/virtualbox: tidying up the linked clone feature 2015-10-06 14:11:41 -04:00
Mitchell Hashimoto d519d927fa Merge branch 'VB-linked-clone-support' of https://github.com/mpoeter/vagrant into mpoeter-VB-linked-clone-support 2015-10-06 13:50:34 -04:00
ctammes 0556b3b040 Update push.rb
https://github.com/mitchellh/vagrant/issues/5570

When uploading from Windows to Linux, the Windows filepath was added to the Linux path.
2015-10-06 14:02:45 +02:00
Mitchell Hashimoto 2299715b41 providers/virtualbox: code review comments 2015-10-01 17:01:27 -04:00
Mitchell Hashimoto 05fbb4ced2 providers/virtualbox: more support 2015-10-01 08:50:47 -04:00
Mitchell Hashimoto 061a91d09b providers/virtualbox: workaround IPv6 routing bug in VB
VirtualBox has a bug where the IPv6 route is lost on every other
configuration of a host-only network. This is also triggered when a VM
is booted.

To fix this, we test the route-ability of all IPv6 networks, and
reconfigure if necessary. This is very fast but we still only do this if
we have any IPv6 networks.
2015-09-30 18:19:37 -07:00
Mitchell Hashimoto 0d50f454ea providers/virtualbox: VB5 support 2015-09-30 17:29:23 -07:00
Mitchell Hashimoto ec0b0fb7f9 providers/virtualbox: IPv6 host only networks 2015-09-30 17:23:25 -07:00
Maarten De Wispelaere cfd4270cdb FIX bug introduced in #6315 2015-09-28 09:08:20 +02:00
Maarten De Wispelaere e0dad41b0c FIX: no exception for debian 8 needed, shutdown -h -H doesn't work ; use normal shutdown -h now 2015-09-24 12:18:59 +02:00
Trey Briggs a5b6e23e20 Removed extra quote in powershell command. 2015-09-22 23:28:14 -05:00
Trey Briggs ed1c219a07 version is a Symbol, convert to String before concat. 2015-09-22 23:26:02 -05:00
tomfanning 41beaac074 Hyper-V set mac address 2015-09-22 11:35:55 +01:00
Rickard von Essen acde6e1b16 Use dnf on Fedora guests instead of yum if available.
Fixes #6286 now properly installs Docker on Fedora guests.
Fixes #6287 use dnf if available.
2015-09-20 09:30:49 +02:00
Sam Phippen 53714abfa3 Handle encoding errors in shell provisioner newline normalization.
The problem demonstrated in #6065 is that a string has incorrectly been
encoded with US-ASCII even though it contains invalid US-ASCII byte
sequences (any byte with the most significant bit on is invalid in the
US-ASCII encoding).

The thing about doing newline normalization is that it is not actually
sensitive to the presence of US-ASCII byte sequenzes. Additionally, it
is very unlikely that a user will ever be using an encoding where \r\n
is not encoded the same as it would be in ASCII.

This patch first tries the existing method of normalizing the newlines
in the provided script file, if that fails for any reason it force
encodes the string to ASCII-8BIT (which allows the most significant bit
to be on in any individual byte) and then performs the substitution in
that byte space.
2015-09-12 14:36:54 +01:00
Philip Wigg 33b4d6a63d Fix verify_binary for Puppet for Windows guests. 2015-09-11 20:06:21 +01:00
Kristoffer Grönlund 1911586832 Better NFS status check command for SUSE 2015-09-10 10:05:14 +02:00
Jeff Kwan 4b32744424 Use a .NET API call instead of a Win8+ cmdlet
The root cause is that Windows 7 doesn't have Get-NetIPAddress (
see:
https://stackoverflow.com/questions/19529442/gather-ip-address-information
)
but the change was to try and solve the bug that the VPN IP
addresses
aren't visible detailed
here:
https://support.microsoft.com/en-us/kb/2549091

Resolved using the
2nd solution
from
http://serverfault.com/questions/145259/powershell-win32-networkadapterconfiguration-not-seeing-ppp-adapter
2015-09-03 16:54:41 -04:00
Paul Hinze 1e84cc4d6a communicators/winrm: respect boot_timeout when fetching winrm_info
We gained a ton of improvemnts to WinRM error handling in
https://github.com/mitchellh/vagrant/pull/4943, but we also got one bug.

The new code raises an exception when `winrm_info` does not return right
away. This was preventing us from catching the retry/timout logic that's
meant to wait until boot_timeout for the WinRM communicator to be ready.

This restores the proper behavior by rescuing the WinRMNotReady
exception and continuing to retry until the surrounding timeout fires.
2015-09-02 16:36:23 -05:00
Jeff Goldschrafe c7186236f1 Better Ubuntu systemd detection
Check the running process at PID 1 to determine which init system is currently in use.
2015-08-31 17:24:13 -04:00
Jeremy Roberts c844a9c4fd Adding WinRM execution_time_limit to log. 2015-08-31 11:42:35 -04:00
Jeremy Roberts 18d229ca82 Added execution_time_limit for WinRM.
Adds a configurable value for WinRm and the elevated permission shell ExecutionTimeLimit.

Please see mitchellh/vagrant#5506

Ex: config.winrm.execution_time_limit = "P1D"
2015-08-31 11:42:25 -04:00
konomae ad9a7324c5 Fix invalid ini entry error when ansible_ssh_private_key_file contains spaces 2015-08-29 18:00:20 +09:00
Dusty Mabe be90f6b1da Fix Fedora /etc/hosts bug
Update so that localhost entries don't get deleted when the hostname
gets added to the 127.0.0.1 line. Closes #6202
2015-08-27 16:53:21 -04:00
Arlo Louis O'Keeffe af0f267b50 Check if Schedule.Service com object is available 2015-08-26 00:15:03 +02:00
Elan Ruusamäe f71b27ff27 fix network detection on pld-linux
pld linux uses redhat as base, but lacks :flavour
this will add it
2015-08-21 12:49:36 +03:00
Lonnie VanZandt b897fd7365 Scrub Guest Paths for Windows Rsync leaving Dirty Paths for Winrm Mkdir
Windows offers no out-of-the-box rsync utility. By far, the most
commonly used external utilities for Windows rsync are built with the
GNU Cygwin libraries. The cost for this convenience is that rsync on
Windows has to be provided paths that begin “/cygdrive/c” rather than
“c:/“ like other Windows-API utilities. Compounding the situation,
rsync doesn’t create paths/to/sub/targets and so the vagrant plugin
code, when performing an rsync, is responsible for creating
intermediate directories in guest paths if there are any. Furthermore,
the mkdir utility in Windows is not another Cygwin utility like rsync
but the routine mkdir of Windows command.com. Therefore, while rsync
needs the /cygwin paths, mkdir uses the Windows paths. Later, the
chef_solo.rp provisioner running within the guest will expect to find
Windows-style paths in its solo.rb configuration file. Due to all this,
vagrant has to keep track of both the original, possibly dirty Windows
guest path and the cygwin-scrubbed guest path.
2015-08-18 10:56:13 -06:00
Victor Costan 4425d91d86 Don't warn about an .1 IP for DHCP networks
When the network's type is :dhcp, the :ip option is used to derive the DHCP server configuration, and it doesn't actually indicate the IP that will be received by the VM(s).
2015-08-15 06:53:01 -04:00
Manuel Pöter 2a2f0a4751 Use hash of machine name for lock file to avoid problems with invalid characters for file names. 2015-08-12 14:25:54 +02:00
Jason Woods ff941ef4e8 Fix broken masterless minion configuration 2015-08-03 12:11:32 +01:00
John Syrinek ea7b277f41 Prevent fatal error caused by attempting to upload minion config to
privileged directory
2015-07-31 16:05:55 -05:00
Ben Hines 3f29be0de2 Fix string parse error in the environment path missing error message. 2015-07-28 11:16:20 -07:00
지훈 287831dd2e Fix for Issue #6006 - cfengine will now install 2015-07-20 02:08:13 -07:00
Pat O'Shea d34bc38bf3 Updated salt-minion and call ext on windows guest
Salt-minion and salt-call are batch files on a windows guest, not executables.
2015-07-18 20:53:46 -06:00
Mattias Appelgren f349a58a1e provisioners/puppet: Fix Puppet environment default manifest
Also parse the puppet variables $codedir and $environment when
resolving a manifest path from environment.conf
2015-07-18 14:48:03 +02:00
Denis Brækhus d2b0df0a7d Specify time and don't do -h -H which is not really a valid usage. 2015-07-17 21:44:58 +02:00
Mitchell Hashimoto 4b217e2128 Merge pull request #5980 from PatOShea/PatOShea-ConfigDir-Typo
Fixed salt minion configuration directory typo
2015-07-17 12:37:44 -07:00
Jon Burgess 209556c3cd Allow provisioner instance names to be specified for `up` and `reload` commands and option `--provision-with`
Ref: https://github.com/mitchellh/vagrant/issues/5139
2015-07-17 14:26:13 +10:00
Pat O'Shea a4eede0c42 fixed typo for config_dir
Only exposed when calling highstate with config_dir being set
2015-07-16 18:45:59 -06:00
Pat O'Shea 956bbf011c Changed minion config path for windows
Copy of minion is wrong on windows. Moved to sub-dir, conf.
2015-07-16 18:37:36 -06:00