Commit Graph

155 Commits

Author SHA1 Message Date
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
Bob f12f50c552 Raise Errno::ETIMEDOUT as "acceptable" Errors::ConnectionTimeout 2015-07-15 19:41:10 +02:00
Mitchell Hashimoto c1508cd893 kernel/v2: customizable sudo_command [GH-5573] 2015-07-09 09:30:47 -06:00
Mitchell Hashimoto dd69de1073 communicators/ssh: only try auth methods that are valid 2015-07-07 16:06:03 -06: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
Aaron Quint 2f81669394 Move shell_cmd to a method in SSH::Communicator
This allows shell_cmd to be overridable by plugins/patches without
having to override the entire (large) shell_execute method
2015-04-13 13:45:17 -04: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
Seth Vargo d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05: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
Max Lincoln 02f4adc895 Fix broken variable references 2014-12-11 13:21:58 -05:00
Max Lincoln 072bb26a30 Change @ssl to @transport 2014-12-11 13:21:58 -05:00
Max Lincoln b3480049ad DRY the Shell: Don't duplicate the Config, especially since there were differing default values 2014-12-11 13:21:58 -05:00
Max Lincoln 1beb221bf3 Rename no_ssl_peer_verification to ssl_peer_verification, and make it configurable 2014-12-11 13:21:58 -05:00
Peter Ericson 243cc5dc37 config.rb: set default port based on @ssl 2014-12-11 13:20:22 -05:00
Peter Ericson 52d8fddf38 shell.rb: fix precedence 2014-12-11 13:20:22 -05:00
Peter Ericson 4455d2401b Add ssl option to winrm config.rb 2014-12-11 13:19:09 -05:00
Peter Ericson a99d32f60a Add WinRM over SSL support 2014-12-11 13:19:09 -05:00
Mitchell Hashimoto 94b2a8a56b communicators/ssh: insert random key, remove insecure key 2014-10-24 09:58:18 -07:00
Mitchell Hashimoto 381f1332c8 Merge pull request #4670 from gildegoma/dry-check-ssh-perms
Check SSH key permissions in machine.ssh_info
2014-10-23 09:14:31 -07:00
Mitchell Hashimoto 15f16181f5 communicators/ssh: clear out some comments 2014-10-23 09:06:28 -07:00
Konstantin Tretyakov c332287665 Addresses issue #2163
In the situation where the SSH key has invalid permissions/owner, the reconnect-loop keeps failing repeatedly yet stays silent about the reasons. A message must be reported from the default exception handler (added). In addition, the situations where the SSH key owner or permissions are wrong must lead to a proper failure (added). Ideally, though, the owner/permissions check must happen before launching the VM, hence this is not a perfect fix.
2014-10-23 15:11:10 +03:00
Mitchell Hashimoto 5ebd10c19c communicators/ssh: timeout on connection check 2014-10-21 17:00:05 -07:00
Gilles Cornu 4e81be879c Check SSH key permissions in machine.ssh_info
With this change, any caller of machine.ssh_info is assured that best
efforts will be done to fix possible wrong permissions on the private
key files.

Fix #4652
2014-10-20 17:33:06 +02:00
Mitchell Hashimoto 4af0f9b9c6 whitespace 2014-10-18 16:13:01 -07:00
Nicolas Philippe 1bb61fb3f9 Fix for issue #4452 : undefined stdout in communicator.rb
Fixes #4452.
The stdout variable was changed during commit
https://github.com/mitchellh/vagrant/commit/138aa5aad375ac0c076a0e0a3493
e25906ce0434 . This commit just corrects this omission.
2014-09-03 20:47:46 -05:00
Mitchell Hashimoto be6665864d communicators/ssh: nicer errors for SSH exceptions [GH-4367] 2014-08-29 11:40:50 -07:00
Mitchell Hashimoto 069230a563 Merge pull request #4383 from mwrock/error
communicators/winrm: handle errors that do not set an exit code
2014-08-29 09:50:41 -07:00
Mitchell Hashimoto 138aa5aad3 communicators/ssh: cleanup PTY code for GH-4408] 2014-08-29 09:41:35 -07:00
Leo Simons 87fb5d11fe Preserve exit code while using pseudo-terminal hack. 2014-08-29 11:50:22 +02:00
Leo Simons a0d3719b52 Scrub SSH PTY output to filter out command echo-ing. 2014-08-28 18:02:27 +02:00
Matt Wrock e22767184b exit wit code 1 from powershell commands that fail but do not send an exit code 2014-08-24 10:18:03 -07:00
Stefan Scherer f0ef46f648 write to stdout before exit 1 2014-08-17 16:22:35 +02:00
Mitchell Hashimoto 6e4541110b Merge pull request #4313 from w3ttr3y/master
Fixes 4309: Error when provisioning Windows host using Puppet
2014-08-08 18:24:53 -07:00
Mitchell Hashimoto 0da5d7b650 communicators/ssh: clean error on max session [GH-4044] 2014-08-08 09:11:25 -07:00
Mitchell Hashimoto 5ed0b22c78 communicators/ssh: cleaner error if remote disconnect [GH-4038] 2014-08-07 11:53:44 -07:00
William E. Triest. III 4a2566c646 Fixes 4309
When the winrm communicator executes a command in an elevated shell,
this patch causes it to escape double quotes.

This is necessary as the first line in the file that it produces and
then executes it puts the command into a variable called command that
is delimited by double quotes.
2014-08-07 08:49:36 -04:00
Mitchell Hashimoto 00bd226fc7 guests/nixos: don't detect as Windows [GH-4302] 2014-08-06 11:17:41 -07:00