Commit Graph

100 Commits

Author SHA1 Message Date
Bryce Shurts ba3c26b211 Updating winrm_info_invalid to use start_with instead of match 2017-10-05 10:28:10 -05:00
Bryce Shurts 0eaf691ea0 Adding check for APIPA in winrm helper to fix #8996 2017-09-25 16:31:37 -05:00
Brian Cain a9564b2137 (#8933) Align file provisioner functionality on all platforms
This commit aligns how the file provisioner should work on all host
machines. It ensures that a `/.` is only applied if the user intended
to upload a folder to a destination under a different name. It ensures
that if uploading to a windows guest with a different destination folder
name, it does not nest the source folder under that name so that it
works the same as it does on linux platforms. It also updates the
behavior of the winrm upload communicator by allowing an array of paths
to be uploaded instead of a single file or folder to allow for this new
functionality for windows guests.
2017-08-31 15:57:53 -07: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
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 f72cd286c1 Merge pull request #7831 from mwrock/nano
Use the cmd shell to check winrm availability to fix `vagrant up --no-provision` on nano
2016-09-30 16:16:42 -07:00
Matt Wrock c5e1a6d8c0 use the cmd shell to check winrm availability 2016-09-26 14:07:11 -07:00
Matt Wrock 64828f1ed3 fix #7489 preventing winrm connection leakage 2016-08-13 07:49:08 -07:00
Seth Vargo 7014aa3bab
Remove custom tempfile class
This is not actually providing any additional utility and also causes
namespace conflicts with people trying to use the real Tempfile class.
2016-05-30 23:21:47 -04:00
Seth Vargo 5a4f345363
Use Util::Tempfile when configuring networks
This fixes a fairly large tempfile leak. Vagrant uses a template
renderer to write network configuration files locally to disk. Then,
that temporarily file is uploaded to the remote host and moved into
place. Since Vagrant is such a short-lived process, GC never came along
and cleaned up those tempfiles, resulting in many temporary files being
created through regular Vagrant usage.

The Util::Tempfile class uses a block to ensure the temporary file is
deleted when the block finishes. This API required small tweaks to the
usage, but provides more safety to ensure the files are deleted.
2016-05-28 23:22:34 -04:00
Matt Wrock f912a81362 powershell and cmd calls should use commnand_executor to reuse oprn winrm shell 2016-01-27 11:59:10 -08:00
Matt Wrock d3819d40bf pass winrm debug logging to vagrant logger 2016-01-27 11:59:10 -08:00
Matt Wrock 7ef4ae9e10 use NTLM/Negotiate authentication over basic authentication 2016-01-27 11:57:41 -08:00
Matt Wrock 9fc431f776 remove call to deprecated toggle_nori_type_casting in winrm 2016-01-24 10:54:09 -08:00
Mitchell Hashimoto d657804f18 Merge branch 'master' of https://github.com/matthewcodes/vagrant into matthewcodes-master 2015-11-18 15:09:47 -08:00
Seng Lin Shee 774940521e Ignore Powershell progress updates on stderr
Starting with PowerShell 5, the progress bar can be observed via the
Write-Progress cmdlet. From WinRM, this appears as a stderr output.
Vagrant assumes that there is error if output appears on stderr.

This terminates various scripts which previously executed successfully
in Vagrant (prior to Windows 10).

This fix injects a variable assignment at various points of the script
execution process to disable display of the progress bar.
2015-11-18 13:52:25 -08:00
Mitchell Hashimoto d3bcc4e5f9 Merge pull request #6213 from jrob/winrm-execution-timeout
Winrm execution timeout
2015-11-18 13:00:59 -08:00
Mitchell Hashimoto 10c53dfb4b update CHANGELOG 2015-11-18 12:54:42 -08:00
Mitchell Hashimoto 34dc9e237e Merge pull request #6195 from ArloL/fix-windows-xp-shell-provisioning
Check if Schedule.Service com object is available
2015-11-18 12:52:24 -08:00
Mitchell Hashimoto dde21bc95a fix file permissions 2015-11-18 12:48:41 -08:00
Mitchell Hashimoto 37940e7350 Merge pull request #6185 from marc-ta/elevated_interactive
Elevated interactive
2015-11-18 12:46:39 -08:00
Mitchell Hashimoto 8bbf6f56f4 Merge pull request #4400 from mwrock/ps-cmd
Add a ps command to vagrant that drops the user into a remote powershell shell
2015-11-18 10:41:36 -08: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
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
Marc Siegfriedt 8e87990599 add the option to make elevated interactive scripts 2015-10-15 12:25:50 -07: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
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
Arlo Louis O'Keeffe af0f267b50 Check if Schedule.Service com object is available 2015-08-26 00:15:03 +02:00
Bob f12f50c552 Raise Errno::ETIMEDOUT as "acceptable" Errors::ConnectionTimeout 2015-07-15 19:41:10 +02:00
Shawn Neal 1152b4e1df Fix issue 5790
Leaving around plaintext username and passwords in a script on a box isn't the best from a security standpoint. This change ensures the scheduled task wrapper script for WinRM doesn't leave these around on the box, and instead passes them to the script as arguments.
2015-06-10 16:04:46 -07:00
Matt Wrock 1cd1033093 fixes from @sethvargo comments. 2015-06-05 05:07:12 -07:00
Paul Hinze 291db96510 communicators/winrm: don't stop task on idle end
StopOnIdleEnd was set in the task definition for elevated/privileged
windows guest scripts. This setting:

> specifies that the task stops when the idle condition ceases to be true [1]

The "idle condition" is something that Windows periodically checks for,
and it's defined by a bunch of criteria like user presence/absence, CPU
/ IO idle time, etc. [2]

Telling our provisioner to stop the task if the "idle condition" ceases
to be true is a recipe for some sporadically stopped tasks, which seems
like precisely the behavior being reported in #5362.

I'm pretty sure this fixes #5362

[1] https://msdn.microsoft.com/en-us/library/cc248332.aspx
[2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa383561%28v=vs.85%29.aspx
2015-03-12 15:25:40 -05:00
Max Lincoln 39882957ee Add retry_delay setting to speed up test 2015-01-28 13:41:07 -05:00
Max Lincoln 5d5e13bc0f Change authorization error tests to match WinRM 1.3 2015-01-28 13:41:07 -05:00
Max Lincoln c37c12526a Merge branch 'master' of github.com:mitchellh/vagrant into winrm_error_handling
Conflicts:
	vagrant.gemspec
2015-01-28 10:44:47 -05:00
Max Lincoln 29845e926c Merge branch 'master' into winrm_error_handling 2015-01-20 16:16:48 -05:00
Max Lincoln edc867986b Merge branch 'master' into winrm_error_handling 2015-01-20 16:07:00 -05:00
Shawn Neal 31163da0d5 Use winrm-fs for file uploads
Replace the Vagrant native winrm file upload functionality with the winrm-fs gem.
2015-01-20 11:45:57 -08:00
Vít Ondruch 7d3b5352da Remove unneeded executable permissions. 2015-01-20 11:53:30 +01:00
Mitchell Hashimoto 79873cdb44 communicators/winrm: detect parse errors in powershell and error
/cc @sneal - Any better way to do this?
2015-01-05 16:53:17 -08:00
Shawn Neal c4422d7c70 Fix guest autodetection when running windows guests so Vagrant doesn't think the guest is Ubuntu 2014-12-16 08:20:01 -08:00
Max Lincoln e7e50d39d9 Fix tests - all pass but auth retry test is extremely slow 2014-12-11 13:23:40 -05:00
Max Lincoln 24de8a1fb7 Just use ready? 2014-12-11 13:22:39 -05:00
Max Lincoln ba7b964b1e Better error handling for WinRM (using winrm v1.3.0.dev.2) 2014-12-11 13:22:39 -05:00
Max Lincoln 24f919c4d3 Fix accessors used by in communicator.rb 2014-12-11 13:22:39 -05:00
Max Lincoln 2caaf82ae0 Change default transport back to :plaintext, for backwards compatibility 2014-12-11 13:21:58 -05:00