vagrant-azure 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +19 -15
  3. data/CHANGELOG.md +24 -24
  4. data/Gemfile +20 -15
  5. data/LICENSE +4 -4
  6. data/README.md +189 -125
  7. data/Rakefile +15 -14
  8. data/lib/vagrant-azure.rb +31 -33
  9. data/lib/vagrant-azure/action.rb +267 -243
  10. data/lib/vagrant-azure/action/connect_azure.rb +49 -46
  11. data/lib/vagrant-azure/action/os_type.rb +34 -0
  12. data/lib/vagrant-azure/action/powershell_run.rb +28 -0
  13. data/lib/vagrant-azure/action/provision.rb +42 -49
  14. data/lib/vagrant-azure/action/rdp.rb +63 -62
  15. data/lib/vagrant-azure/action/read_ssh_info.rb +54 -51
  16. data/lib/vagrant-azure/action/read_state.rb +47 -46
  17. data/lib/vagrant-azure/action/read_winrm_info.rb +57 -0
  18. data/lib/vagrant-azure/action/restart_vm.rb +28 -27
  19. data/lib/vagrant-azure/action/run_instance.rb +123 -115
  20. data/lib/vagrant-azure/action/start_instance.rb +35 -35
  21. data/lib/vagrant-azure/action/stop_instance.rb +42 -38
  22. data/lib/vagrant-azure/action/sync_folders.rb +64 -63
  23. data/lib/vagrant-azure/action/terminate_instance.rb +34 -34
  24. data/lib/vagrant-azure/action/vagrant_azure_service.rb +44 -43
  25. data/lib/vagrant-azure/action/wait_for_communicate.rb +39 -38
  26. data/lib/vagrant-azure/action/wait_for_state.rb +50 -49
  27. data/lib/vagrant-azure/capabilities/winrm.rb +12 -0
  28. data/lib/vagrant-azure/command/powershell.rb +43 -0
  29. data/lib/vagrant-azure/command/rdp.rb +24 -0
  30. data/lib/vagrant-azure/config.rb +158 -147
  31. data/lib/vagrant-azure/driver.rb +48 -84
  32. data/lib/vagrant-azure/errors.rb +28 -27
  33. data/lib/vagrant-azure/monkey_patch/azure.rb +46 -0
  34. data/lib/vagrant-azure/monkey_patch/winrm.rb +77 -0
  35. data/lib/vagrant-azure/plugin.rb +102 -91
  36. data/lib/vagrant-azure/provider.rb +74 -70
  37. data/lib/vagrant-azure/provisioner/chef-solo.rb +178 -177
  38. data/lib/vagrant-azure/provisioner/puppet.rb +116 -115
  39. data/lib/vagrant-azure/version.rb +11 -10
  40. data/locales/en.yml +37 -37
  41. data/templates/provisioners/chef-solo/solo.erb +51 -51
  42. data/vagrant-azure.gemspec +59 -58
  43. metadata +48 -38
  44. data/lib/vagrant-azure/command/rdp/command.rb +0 -21
  45. data/lib/vagrant-azure/communication/powershell.rb +0 -41
  46. data/lib/vagrant-azure/monkey_patch/machine.rb +0 -22
  47. data/lib/vagrant-azure/provisioner/shell.rb +0 -83
  48. data/lib/vagrant-azure/scripts/check_winrm.ps1 +0 -47
  49. data/lib/vagrant-azure/scripts/export_vm.ps1 +0 -31
  50. data/lib/vagrant-azure/scripts/file_sync.ps1 +0 -145
  51. data/lib/vagrant-azure/scripts/host_info.ps1 +0 -25
  52. data/lib/vagrant-azure/scripts/hyperv_manager.ps1 +0 -36
  53. data/lib/vagrant-azure/scripts/run_in_remote.ps1 +0 -32
  54. data/lib/vagrant-azure/scripts/upload_file.ps1 +0 -95
  55. data/lib/vagrant-azure/scripts/utils/create_session.ps1 +0 -34
  56. data/lib/vagrant-azure/scripts/utils/write_messages.ps1 +0 -18
@@ -0,0 +1,12 @@
1
+ module VagrantPlugins
2
+ module WinAzure
3
+ module Cap
4
+ class WinRM
5
+ def self.winrm_info(machine)
6
+ env = machine.action('read_winrm_info')
7
+ env[:machine_winrm_info]
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,43 @@
1
+ module VagrantPlugins
2
+ module WinAzure
3
+ module Command
4
+ class PowerShell < Vagrant.plugin('2', :command)
5
+ def self.synopsis
6
+ 'execute PowerShell command or script on remote machine'
7
+ end
8
+
9
+ def execute
10
+ options = {}
11
+
12
+ opts = OptionParser.new do |o|
13
+ o.banner = 'Usage: vagrant powershell [machine] -[c|s] [command|script file]'
14
+ o.separator ''
15
+ o.separator 'Options:'
16
+ o.separator ''
17
+
18
+ o.on('-c', '--command COMMAND', 'Execute a PowerShell command directly') do |c|
19
+ options[:command] = c
20
+ end
21
+
22
+ o.on('-s', '--script SCRIPT_FILE', 'Execute a PowerShell script directly') do |s|
23
+ raise Vagrant::Errors::CLIInvalidOptions, :help => "File #{s} can't be found. Does it exist?" unless File.exists?(s)
24
+ options[:command] = File.read(s)
25
+ end
26
+ end
27
+
28
+ argv = parse_options(opts)
29
+ if options.empty?
30
+ raise Vagrant::Errors::CLIInvalidOptions, :help => opts.help.chomp
31
+ end
32
+
33
+ with_target_vms(argv, single_target: true) do |vm|
34
+ @logger.debug("Executing single command on remote machine: #{options[:command]}")
35
+
36
+ vm.action(:powershell_run, powershell_command: options[:command])
37
+ end
38
+ 0
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,24 @@
1
+ #--------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache License, Version 2.0.
4
+ # See License.txt in the project root for license information.
5
+ #--------------------------------------------------------------------------
6
+ module VagrantPlugins
7
+ module WinAzure
8
+ module Command
9
+ class RDP < Vagrant.plugin('2', :command)
10
+ def self.synopsis
11
+ 'opens an RDP session for a vagrant machine'
12
+ end
13
+
14
+ def execute
15
+ with_target_vms do |vm|
16
+ vm.action(:rdp)
17
+ end
18
+
19
+ 0
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,147 +1,158 @@
1
- #--------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Open Technologies, Inc.
3
- # All Rights Reserved. Licensed under the Apache 2.0 License.
4
- #--------------------------------------------------------------------------
5
- require 'vagrant'
6
- require 'azure'
7
-
8
- module VagrantPlugins
9
- module WinAzure
10
- class Config < Vagrant.plugin('2', :config)
11
- attr_accessor :mgmt_certificate
12
- attr_accessor :mgmt_endpoint
13
- attr_accessor :subscription_id
14
- attr_accessor :storage_acct_name
15
- attr_accessor :storage_access_key
16
-
17
- attr_accessor :vm_name
18
- attr_accessor :vm_user
19
- attr_accessor :vm_password
20
- attr_accessor :vm_image
21
- attr_accessor :vm_location
22
- attr_accessor :vm_affinity_group
23
-
24
- attr_accessor :cloud_service_name
25
- attr_accessor :deployment_name
26
- attr_accessor :tcp_endpoints
27
- attr_accessor :ssh_private_key_file
28
- attr_accessor :ssh_certificate_file
29
- attr_accessor :ssh_port
30
- attr_accessor :vm_size
31
- attr_accessor :winrm_transport
32
- attr_accessor :winrm_http_port
33
- attr_accessor :winrm_https_port
34
- attr_accessor :availability_set_name
35
-
36
- attr_accessor :state_read_timeout
37
-
38
- def initialize
39
- @storage_acct_name = UNSET_VALUE
40
- @storage_access_key = UNSET_VALUE
41
- @mgmt_certificate = UNSET_VALUE
42
- @mgmt_endpoint = UNSET_VALUE
43
- @subscription_id = UNSET_VALUE
44
-
45
- @vm_name = UNSET_VALUE
46
- @vm_user = UNSET_VALUE
47
- @vm_password = UNSET_VALUE
48
- @vm_image = UNSET_VALUE
49
- @vm_location = UNSET_VALUE
50
- @vm_affinity_group = UNSET_VALUE
51
-
52
- @cloud_service_name = UNSET_VALUE
53
- @deployment_name = UNSET_VALUE
54
- @tcp_endpoints = UNSET_VALUE
55
- @ssh_private_key_file = UNSET_VALUE
56
- @ssh_certificate_file = UNSET_VALUE
57
- @ssh_port = UNSET_VALUE
58
- @vm_size = UNSET_VALUE
59
- @winrm_transport = UNSET_VALUE
60
- @winrm_http_port = UNSET_VALUE
61
- @winrm_https_port = UNSET_VALUE
62
- @availability_set_name = UNSET_VALUE
63
- @state_read_timeout = UNSET_VALUE
64
- end
65
-
66
- def finalize!
67
- @storage_acct_name = ENV["AZURE_STORAGE_ACCOUNT"] if \
68
- @storage_acct_name == UNSET_VALUE
69
- @storage_access_key = ENV["AZURE_STORAGE_ACCESS_KEY"] if \
70
- @storage_access_key == UNSET_VALUE
71
- @mgmt_certificate = ENV["AZURE_MANAGEMENT_CERTIFICATE"] if \
72
- @mgmt_certificate == UNSET_VALUE
73
- @mgmt_endpoint = ENV["AZURE_MANAGEMENT_ENDPOINT"] if \
74
- @mgmt_endpoint == UNSET_VALUE
75
- @subscription_id = ENV["AZURE_SUBSCRIPTION_ID"] if \
76
- @subscription_id == UNSET_VALUE
77
-
78
- @vm_name = nil if @vm_name == UNSET_VALUE
79
- @vm_user = 'vagrant' if @vm_user == UNSET_VALUE
80
- @vm_password = nil if @vm_password == UNSET_VALUE
81
- @vm_image = nil if @vm_image == UNSET_VALUE
82
- @vm_location = nil if @vm_location == UNSET_VALUE
83
- @vm_affinity_group = nil if @vm_affinity_group == UNSET_VALUE
84
-
85
- @cloud_service_name = nil if @cloud_service_name == UNSET_VALUE
86
- @deployment_name = nil if @deployment_name == UNSET_VALUE
87
- @tcp_endpoints = nil if @tcp_endpoints == UNSET_VALUE
88
- @ssh_private_key_file = nil if @ssh_private_key_file == UNSET_VALUE
89
- @ssh_certificate_file = nil if @ssh_certificate_file == UNSET_VALUE
90
- @ssh_port = nil if @ssh_port == UNSET_VALUE
91
- @vm_size = nil if @vm_size == UNSET_VALUE
92
- @winrm_transport = nil if @winrm_transport == UNSET_VALUE
93
- @winrm_http_port = nil if @winrm_http_port == UNSET_VALUE
94
- @winrm_https_port = nil if @winrm_https_port == UNSET_VALUE
95
- @availability_set_name = nil if @availability_set_name == UNSET_VALUE
96
-
97
- @state_read_timeout = 360 if @state_read_timeout == UNSET_VALUE
98
-
99
- # This done due to a bug in Ruby SDK - it doesn't generate a storage
100
- # account name if add_role = true
101
- if @storage_acct_name.nil? || @storage_acct_name.empty?
102
- @storage_acct_name = Azure::Core::Utility.random_string(
103
- "#{@vm_name}storage"
104
- ).gsub(/[^0-9a-z ]/i, '').downcase[0..23]
105
- end
106
-
107
- if @cloud_service_name.nil? || @cloud_service_name.empty?
108
- @cloud_service_name = Azure::Core::Utility.random_string(
109
- "#{@vm_name}-service-"
110
- )
111
- end
112
- end
113
-
114
- def merge(other)
115
- super.tap do |result|
116
- result.mgmt_certificate = other.mgmt_certificate || \
117
- self.mgmt_certificate
118
- result.mgmt_endpoint = other.mgmt_endpoint || \
119
- self.mgmt_endpoint
120
- result.subscription_id = other.subscription_id || \
121
- self.subscription_id
122
- result.storage_acct_name = other.storage_acct_name || \
123
- self.storage_acct_name
124
- result.storage_access_key = other.storage_access_key || \
125
- self.storage_access_key
126
- end
127
- end
128
-
129
- def validate(machine)
130
- errors = _detected_errors
131
-
132
- # Azure connection properties related validation.
133
- errors << "vagrant_azure.subscription_id.required" if \
134
- @subscription_id.nil?
135
- errors << "vagrant_azure.mgmt_certificate.required" if \
136
- @mgmt_certificate.nil?
137
- errors << "vagrant_azure.mgmt_endpoint.required" if \
138
- @mgmt_endpoint.nil?
139
-
140
- # Azure Virtual Machine related validation
141
- errors << "vagrant_azure.vm_name.required" if @vm_name.nil?
142
-
143
- { "Windows Azure Provider" => errors }
144
- end
145
- end
146
- end
147
- end
1
+ #--------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache License, Version 2.0.
4
+ # See License.txt in the project root for license information.
5
+ #--------------------------------------------------------------------------
6
+ require 'vagrant'
7
+ require 'azure'
8
+
9
+ module VagrantPlugins
10
+ module WinAzure
11
+ class Config < Vagrant.plugin('2', :config)
12
+ attr_accessor :mgmt_certificate
13
+ attr_accessor :mgmt_endpoint
14
+ attr_accessor :subscription_id
15
+ attr_accessor :storage_acct_name
16
+ attr_accessor :storage_access_key
17
+
18
+ attr_accessor :vm_name
19
+ attr_accessor :vm_user
20
+ attr_accessor :vm_password
21
+ attr_accessor :vm_image
22
+ attr_accessor :vm_location
23
+ attr_accessor :vm_affinity_group
24
+
25
+ attr_accessor :cloud_service_name
26
+ attr_accessor :deployment_name
27
+ attr_accessor :tcp_endpoints
28
+
29
+ # ssh_private_key and ssh_certificate_file is overly specific and probably should be deprecated in favor of
30
+ # private_key_file and certificate_file as they are in Azure ruby sdk.
31
+ # This is here to not break compatibility with previous versions.
32
+ attr_accessor :private_key_file
33
+ alias :ssh_private_key_file :private_key_file
34
+ alias :ssh_private_key_file= :private_key_file=
35
+
36
+ attr_accessor :certificate_file
37
+ alias :ssh_certificate_file :certificate_file
38
+ alias :ssh_certificate_file= :certificate_file=
39
+
40
+ attr_accessor :ssh_port
41
+ attr_accessor :vm_size
42
+ attr_accessor :winrm_transport
43
+ attr_accessor :winrm_http_port
44
+ attr_accessor :winrm_https_port
45
+ attr_accessor :availability_set_name
46
+
47
+ attr_accessor :state_read_timeout
48
+
49
+ def initialize
50
+ @storage_acct_name = UNSET_VALUE
51
+ @storage_access_key = UNSET_VALUE
52
+ @mgmt_certificate = UNSET_VALUE
53
+ @mgmt_endpoint = UNSET_VALUE
54
+ @subscription_id = UNSET_VALUE
55
+
56
+ @vm_name = UNSET_VALUE
57
+ @vm_user = UNSET_VALUE
58
+ @vm_password = UNSET_VALUE
59
+ @vm_image = UNSET_VALUE
60
+ @vm_location = UNSET_VALUE
61
+ @vm_affinity_group = UNSET_VALUE
62
+
63
+ @cloud_service_name = UNSET_VALUE
64
+ @deployment_name = UNSET_VALUE
65
+ @tcp_endpoints = UNSET_VALUE
66
+ @private_key_file = UNSET_VALUE
67
+ @certificate_file = UNSET_VALUE
68
+ @ssh_port = UNSET_VALUE
69
+ @vm_size = UNSET_VALUE
70
+ @winrm_transport = UNSET_VALUE
71
+ @winrm_http_port = UNSET_VALUE
72
+ @winrm_https_port = UNSET_VALUE
73
+ @availability_set_name = UNSET_VALUE
74
+ @state_read_timeout = UNSET_VALUE
75
+ end
76
+
77
+ def finalize!
78
+ @storage_acct_name = ENV["AZURE_STORAGE_ACCOUNT"] if \
79
+ @storage_acct_name == UNSET_VALUE
80
+ @storage_access_key = ENV["AZURE_STORAGE_ACCESS_KEY"] if \
81
+ @storage_access_key == UNSET_VALUE
82
+ @mgmt_certificate = ENV["AZURE_MANAGEMENT_CERTIFICATE"] if \
83
+ @mgmt_certificate == UNSET_VALUE
84
+ @mgmt_endpoint = ENV["AZURE_MANAGEMENT_ENDPOINT"] if \
85
+ @mgmt_endpoint == UNSET_VALUE
86
+ @subscription_id = ENV["AZURE_SUBSCRIPTION_ID"] if \
87
+ @subscription_id == UNSET_VALUE
88
+
89
+ @vm_name = nil if @vm_name == UNSET_VALUE
90
+ @vm_user = 'vagrant' if @vm_user == UNSET_VALUE
91
+ @vm_password = nil if @vm_password == UNSET_VALUE
92
+ @vm_image = nil if @vm_image == UNSET_VALUE
93
+ @vm_location = nil if @vm_location == UNSET_VALUE
94
+ @vm_affinity_group = nil if @vm_affinity_group == UNSET_VALUE
95
+
96
+ @cloud_service_name = nil if @cloud_service_name == UNSET_VALUE
97
+ @deployment_name = nil if @deployment_name == UNSET_VALUE
98
+ @tcp_endpoints = nil if @tcp_endpoints == UNSET_VALUE
99
+ @private_key_file = nil if @private_key_file == UNSET_VALUE
100
+ @certificate_file = nil if @certificate_file == UNSET_VALUE
101
+ @ssh_port = nil if @ssh_port == UNSET_VALUE
102
+ @vm_size = nil if @vm_size == UNSET_VALUE
103
+ @winrm_transport = nil if @winrm_transport == UNSET_VALUE
104
+ @winrm_http_port = nil if @winrm_http_port == UNSET_VALUE
105
+ @winrm_https_port = nil if @winrm_https_port == UNSET_VALUE
106
+ @availability_set_name = nil if @availability_set_name == UNSET_VALUE
107
+
108
+ @state_read_timeout = nil if @state_read_timeout == UNSET_VALUE
109
+
110
+ # This done due to a bug in Ruby SDK - it doesn't generate a storage
111
+ # account name if add_role = true
112
+ if @storage_acct_name.nil? || @storage_acct_name.empty?
113
+ @storage_acct_name = Azure::Core::Utility.random_string(
114
+ "#{@vm_name}storage"
115
+ ).gsub(/[^0-9a-z ]/i, '').downcase[0..23]
116
+ end
117
+
118
+ if @cloud_service_name.nil? || @cloud_service_name.empty?
119
+ @cloud_service_name = Azure::Core::Utility.random_string(
120
+ "#{@vm_name}-service-"
121
+ )
122
+ end
123
+ end
124
+
125
+ def merge(other)
126
+ super.tap do |result|
127
+ result.mgmt_certificate = other.mgmt_certificate || \
128
+ self.mgmt_certificate
129
+ result.mgmt_endpoint = other.mgmt_endpoint || \
130
+ self.mgmt_endpoint
131
+ result.subscription_id = other.subscription_id || \
132
+ self.subscription_id
133
+ result.storage_acct_name = other.storage_acct_name || \
134
+ self.storage_acct_name
135
+ result.storage_access_key = other.storage_access_key || \
136
+ self.storage_access_key
137
+ end
138
+ end
139
+
140
+ def validate(machine)
141
+ errors = _detected_errors
142
+
143
+ # Azure connection properties related validation.
144
+ errors << "vagrant_azure.subscription_id.required" if \
145
+ @subscription_id.nil?
146
+ errors << "vagrant_azure.mgmt_certificate.required" if \
147
+ @mgmt_certificate.nil?
148
+ errors << "vagrant_azure.mgmt_endpoint.required" if \
149
+ @mgmt_endpoint.nil?
150
+
151
+ # Azure Virtual Machine related validation
152
+ errors << "vagrant_azure.vm_name.required" if @vm_name.nil?
153
+
154
+ { "Windows Azure Provider" => errors }
155
+ end
156
+ end
157
+ end
158
+ end
@@ -1,84 +1,48 @@
1
- #---------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Open Technologies, Inc.
3
- # All Rights Reserved. Licensed under the Apache 2.0 License.
4
- #--------------------------------------------------------------------------
5
- require 'json'
6
- require "#{Vagrant::source_root}/plugins/providers/hyperv/driver"
7
-
8
- module VagrantPlugins
9
- module WinAzure
10
- class Driver < VagrantPlugins::HyperV::Driver
11
- def initialize(machine)
12
- @id = machine.id
13
- @machine = machine
14
- end
15
-
16
- def ssh_info
17
- @ssh_info ||= @machine.provider.winrm_info
18
- @ssh_info[:username] ||= @machine.config.ssh.username
19
- @ssh_info[:password] ||= @machine.config.ssh.password
20
- @ssh_info
21
- end
22
-
23
- def remote_credentials
24
- @remote_credentials ||= {
25
- guest_ip: ssh_info[:host],
26
- guest_port: ssh_info[:port],
27
- username: ssh_info[:username],
28
- password: ssh_info[:password]
29
- }
30
- end
31
-
32
- def run_remote_ps(command, &block)
33
- options = remote_credentials.merge(command: command)
34
- script_path = local_script_path('run_in_remote.ps1')
35
-
36
- ps_options = []
37
-
38
- options.each do |key, value|
39
- ps_options << "-#{key}"
40
- ps_options << "'#{value}'"
41
- end
42
-
43
- ps_options << '-ErrorAction' << 'Stop'
44
- opts = { notify: [:stdout, :stderr, :stdin] }
45
- Vagrant::Util::PowerShell.execute(
46
- script_path,
47
- *ps_options,
48
- **opts,
49
- &block
50
- )
51
- end
52
-
53
- def upload(from, to)
54
- options = {
55
- host_path: windows_path(from),
56
- guest_path: windows_path(to)
57
- }.merge(remote_credentials)
58
-
59
- script_path = local_script_path('upload_file.ps1')
60
- execute(script_path, options)
61
- end
62
-
63
- def check_winrm
64
- script_path = local_script_path('check_winrm.ps1')
65
- execute(script_path, remote_credentials)
66
- end
67
-
68
- protected
69
-
70
- def local_script_path(path)
71
- lib_path = Pathname.new(File.expand_path('../scripts', __FILE__))
72
- windows_path(lib_path.join(path).to_s)
73
- end
74
-
75
- def windows_path(path)
76
- if path
77
- path = path.gsub('/', "\\")
78
- path = "c:#{path}" if path =~ /^\\/
79
- end
80
- path
81
- end
82
- end
83
- end
84
- end
1
+ #---------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache License, Version 2.0.
4
+ # See License.txt in the project root for license information.
5
+ #--------------------------------------------------------------------------
6
+ require 'json'
7
+ require "#{Vagrant::source_root}/plugins/providers/hyperv/driver"
8
+
9
+ module VagrantPlugins
10
+ module WinAzure
11
+ class Driver < VagrantPlugins::HyperV::Driver
12
+ def initialize(machine)
13
+ @id = machine.id
14
+ @machine = machine
15
+ end
16
+
17
+ def ssh_info
18
+ @ssh_info ||= @machine.provider.winrm_info
19
+ @ssh_info[:username] ||= @machine.config.ssh.username
20
+ @ssh_info[:password] ||= @machine.config.ssh.password
21
+ @ssh_info
22
+ end
23
+
24
+ def remote_credentials
25
+ @remote_credentials ||= {
26
+ guest_ip: ssh_info[:host],
27
+ guest_port: ssh_info[:port],
28
+ username: ssh_info[:username],
29
+ password: ssh_info[:password]
30
+ }
31
+ end
32
+
33
+ def run_remote_ps(command, &block)
34
+ @machine.communicate.execute(command) do |*args|
35
+ block.call(args) unless block.nil?
36
+ end
37
+ end
38
+
39
+ def upload(from, to)
40
+ @machine.communicate.upload(from, to)
41
+ end
42
+
43
+ def check_winrm
44
+ @machine.communicate.ready?
45
+ end
46
+ end
47
+ end
48
+ end