-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Winrm v2 and let winrm-fs do file uploads #543
Conversation
No longer WIP and tested using chef-provisioning-vsphere |
Thanks @mwrock ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We lost the ability to run powershell scripts after this PR, I commented on some possible fixes that will get us up and running again.
else | ||
command_executor.run_powershell_script(command, &block) | ||
end | ||
session.run(command, &block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwrock @tyler-ball we need to default to session.run_powershell_script and only use session.run_cmd if raw options are passed the :raw
options
/cc @ajeba99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -41,8 +41,7 @@ def setup_convergence(action_handler, machine) | |||
|
|||
action_handler.open_stream(machine.node['name']) do |stdout| | |||
action_handler.open_stream(machine.node['name']) do |stderr| | |||
machine.execute(action_handler, "powershell.exe -ExecutionPolicy Unrestricted -NoProfile \"& \"\"#{convergence_options[:install_script_path]}\"\"\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwrock @tyler-ball this is a must have! We need ExecutionPolicy Unrestricted in order to run powershell
/cc @ajeba99
require 'winrm' | ||
::WinRM::WinRMWebService.new(endpoint, type, options) | ||
::WinRM::Connection.new(options).shell(:powershell) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting shell to powershell here may get rid of the need for the :raw block above
Hi @hh can you provide an example of what does not work? We made the breaking change in 2.0 to no longer support |
It's not so much around the :raw, it's more around the ExecutionPolicy
Which since chef-dk 0.18.26 results in:
|
#550 should fix it |
Ah I see. So the big difference with powershell in winrm v2's
|
Added #551 |
Use Winrm v2 and let winrm-fs do file uploads
This PR accomplishes 3 things: