jdmulloy
50d0861de4
Removed extra n from the word "connection"
...
Removed extra n from the word "connection" in "Attempting SSH connection" in logger call.
2014-06-27 19:27:23 -04:00
Shawn Neal
291f01045b
Fixed issue 3918
...
Running Windows guest commands through a scheduled task were not returning the correct exit codes, they were only returning 1 or 0. This has negative consequences especially for Puppet which can return an exit code of 2 for partial success.
Since we're running an executable from inside a powershell encoded command we need to ensure we explicitly propagate the exit code to the original caller just like a regular PowerShell script - in this case cmd /c which in return is called from a scheduled task.
2014-05-28 08:54:36 -07:00
Kalman Hazins
bb052366f7
Change symbols inside hashes to 1.9 JSON-like syntax
2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
d7fa60b5df
communicators/winrm: use winrm_info cap if available [GH-3832]
2014-05-20 20:13:36 -07:00
Mitchell Hashimoto
0485413d0a
Merge pull request #3847 from mitchellh/command-line-too-long-fix-for-winrm
...
guests/windows: fix #3816 long arg list
2014-05-20 19:38:53 -07:00
Mitchell Hashimoto
690c119ae2
communicators/winrm: don't look up forwarded port if non-local [GH-3861]
2014-05-20 19:30:53 -07:00
Shawn Neal
0d3979f80d
Fixed issue 3816
...
Elevated command line is now rendered to a script which is uploaded to the guest and executed. This allows the command line itself to be less than 100 chars to start the script and any user commands are puts into the script which has unlimited* length.
2014-05-19 08:04:59 -07:00
Shawn Neal
823e80fa32
Fixed issue 3729
...
The logic used to read the file contents sometimes would leave lines behind unread. It now defaults to reading all lines and counts each line it has actually read.
2014-05-15 09:17:57 -07:00
Mitchell Hashimoto
782c3762cc
communicators/ssh: rescue another exception for reset
2014-05-09 15:59:15 -07:00
Mitchell Hashimoto
b47df84887
communicators/winrm: fix tests
2014-05-07 10:09:14 -07:00
Mitchell Hashimoto
882c9ad7f6
communicators/winrm: good_exit option
2014-05-07 09:47:47 -07:00
Mitchell Hashimoto
604ae6caa3
communicators/ssh: detect if config.ssh.shell is non-functional [GH-3040]
2014-05-01 21:35:02 -07:00
Shawn Neal
30b0399431
Use new Ruby hash initializer syntax
2014-04-26 21:07:26 -07:00
Shawn Neal
f18a397289
Allow WinRM commands to be run elevated via scheduled task
2014-04-26 21:07:26 -07:00
Shawn Neal
1dd081d866
Don't use interpolated strings for username and password
...
Its possible that usernames and passwords may contain special characters like $
2014-04-26 21:07:26 -07:00
Shawn Neal
045e06455a
Added WinRM elevated shell wrapper script
...
This script creates an immediately run scheduled task using fresh credentials. This is a generic implementation used by the Chef provisioners. The script gets around several limitations in WinRM.
1. Credential hopping
2. The non-default Administrator account sometimes doesn't have true Administrator access when run through WinRM even with UAC disabled.
In short, this script allows commands to run through WinRM just as if they were run directly on the box.
2014-04-26 21:07:26 -07:00
Shawn Neal
cad3dde760
Fixed whitespacing in command_filter and file_manager
2014-04-24 07:52:13 -07:00
Shawn Neal
afeb60c850
ivars should be alphabetized
2014-04-24 07:50:24 -07:00
Shawn Neal
d5d9918e48
Cleanup whitespace and comments in WinRM command filters
2014-04-24 07:49:19 -07:00
Shawn Neal
ab51a786ff
Extract execution_output method from WinRM comm execute
2014-04-23 21:49:28 -07:00
Shawn Neal
4a2a147926
Refactored WinRM test command filter
2014-04-23 21:15:05 -07:00
Shawn Neal
f44c795eed
Integrated WinRM command filter into communicator
...
*nix commands are now filtered out instead of being sent to the guest. This means the command_alias PowerShell script is no longer needed.
Moved the PowerShell exit code helper to the WinRM shell and changed it to always return an exit code.
2014-04-23 20:38:16 -07:00
Shawn Neal
1525aa0f78
Added WinRM grep command filter
...
This is needed because isn't available on Windows and Vagrant guest detection attempts to use grep for some OSs.
2014-04-23 20:37:15 -07:00
Shawn Neal
ac81841b01
test command should expand environment variables
...
'$Env:SystemRoot' does not expand
"$Env:SystemRoot" does expand
2014-04-23 18:26:45 -07:00
Shawn Neal
96ab8f60c5
Added WinRM command filters
...
These will be used to replace the guest side command_alias script that is sent with every communicator execute call. This avoids some uncessary remote calls to the guest, makes it unit testable, and allows larger PowerShell commands to be invoked.
2014-04-23 17:50:20 -07:00
Mitchell Hashimoto
eae3f3243e
Merge pull request #3517 from mitchellh/communicator-support-for-wql
...
communicator/winrm: Communicator support for wql
2014-04-23 06:02:24 -07:00
Shawn Neal
5f4a900d8e
Add WinRM file transfer error and english text
2014-04-22 14:54:13 -07:00
Shawn Neal
f292232ca8
Added Windows guest file manager for recursive uploads
...
- Since WinRM uploads are so slow, MD5 content checking is used
2014-04-22 14:42:13 -07:00
Shawn Neal
9177bd8a48
Added WQL support to Vagrant communicator execute
...
- Removed duplication for WQL specific commands
2014-04-22 11:29:22 -07:00
Mitchell Hashimoto
db64fbf6ef
communicators/winrm: reload shell on reload so we get proper port
2014-04-21 13:56:42 -07:00
Mitchell Hashimoto
6721d8e964
communicators/ssh: just use Ruby 2.0 features
2014-04-21 13:54:52 -07:00
Mitchell Hashimoto
bd51c16700
provisioners/puppet: execute properly with WinRM
2014-04-21 13:54:00 -07:00
Mitchell Hashimoto
47b5a3fcdb
communicators/winrm: silence warnings loading winrm
...
/cc @sneal - I silenced warnings using the built-in util. Also, can you
see if we load here if that load error goes away?
2014-04-21 13:51:27 -07:00
Mitchell Hashimoto
7223e29330
communicators/winrm: fix powershell execution
2014-04-21 13:51:05 -07:00
Mitchell Hashimoto
21ac0810fd
communicators/winrm: more tests
2014-04-21 13:51:04 -07:00
Mitchell Hashimoto
bb9f0aef32
communicators/winrm: autodetect port based on forwarded ports
2014-04-21 13:51:03 -07:00
Mitchell Hashimoto
eebebd8837
communicators/winrm: Config unit tests (a little)
2014-04-21 13:50:59 -07:00
Mitchell Hashimoto
2a8a04ebb9
communicators/winrm: initial import from vagrant-windows
2014-04-21 13:50:58 -07:00
Mitchell Hashimoto
ad8d133293
communicators/ssh: throttle warnings [GH-3442]
2014-04-11 16:17:17 -07:00
Mitchell Hashimoto
77c92d0d11
communicators/ssh: only show warnings after a few attempts [GH-3442]
2014-04-11 14:36:19 -07:00
Hiroshi Miura
a7cc402258
vagrant ssh accept utf8, fix #2744
...
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2014-03-30 12:15:53 +09:00
Mitchell Hashimoto
f7adeadf8d
communicators/ssh: change wording on retry
2014-03-21 17:48:03 -07:00
krazyLee
fb4cb4636e
fix timout typo
2014-03-11 17:27:47 +08:00
Mitchell Hashimoto
c877fc27a7
communicators/ssh: call ready? when waiting
...
This lets things like the SSH key go in
2014-02-26 11:35:41 -08:00
Mitchell Hashimoto
67a0d3d5f1
communicators/ssh: rescue/show correct error messages
2014-02-23 22:31:37 -08:00
Mitchell Hashimoto
2fe2fe79ed
communicators/ssh: properly allow errors through while waiting
2014-02-13 21:04:41 -08:00
Mitchell Hashimoto
ed5e544e63
communicators/ssh: more verbose output about waiting for SSH
2014-02-13 20:59:26 -08:00
Mitchell Hashimoto
14b27ae215
communicators/ssh: cache ssh_info
...
This lowers the number of subprocesses with VirtualBox quite a bit.
2014-02-13 20:34:51 -08:00
Mitchell Hashimoto
3c10bf7721
communicators/ssh: better error message
2014-02-03 12:09:13 +01:00
Justin Campbell
a633b7343a
Fix wording of upload permission error
...
SCPPermissionDenied expects a path, and this is most likely the
destination (to) and not source (from).
[#2804 ]
2014-01-28 13:49:14 -05:00