vagrant-azure 1.0.5 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,177 +1,178 @@
1
- #-------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Open Technologies, Inc.
3
- # All Rights Reserved. Licensed under the Apache 2.0 License.
4
- #--------------------------------------------------------------------------
5
-
6
- require "fileutils"
7
- require "tempfile"
8
-
9
- module VagrantPlugins
10
- module WinAzure
11
- module Provisioner
12
- class ChefSolo
13
- attr_reader :provisioner
14
-
15
- def initialize(env)
16
- @env = env
17
- @provisioner = env[:provisioner]
18
- end
19
-
20
- def provision_for_windows
21
- # Copy the chef cookbooks roles data bags and environment folders to Guest
22
- copy_folder_to_guest(provisioner.cookbook_folders)
23
- copy_folder_to_guest(provisioner.role_folders)
24
- copy_folder_to_guest(provisioner.data_bags_folders)
25
- copy_folder_to_guest(provisioner.environments_folders)
26
-
27
- # Upload Encrypted data bag
28
- upload_encrypted_data_bag_secret if config.encrypted_data_bag_secret_key_path
29
- setup_json
30
- setup_solo_config
31
- run_chef_solo
32
-
33
- # TODO
34
- # delete_encrypted_data_bag_secret
35
- end
36
-
37
- def setup_json
38
- @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.json")
39
-
40
- # Get the JSON that we're going to expose to Chef
41
- json = config.json
42
- json[:run_list] = config.run_list if !config.run_list.empty?
43
- json = JSON.pretty_generate(json)
44
-
45
- # Create a temporary file to store the data so we
46
- # can upload it
47
- temp = Tempfile.new("vagrant")
48
- temp.write(json)
49
- temp.close
50
-
51
- remote_file = File.join(config.provisioning_path, "dna.json")
52
- @env[:machine].provider.driver.upload(temp.path, remote_file)
53
- end
54
-
55
- def setup_solo_config
56
- cookbooks_path = guest_paths(provisioner.cookbook_folders)
57
- roles_path = guest_paths(provisioner.role_folders)
58
- data_bags_path = guest_paths(provisioner.data_bags_folders).first
59
- environments_path = guest_paths(provisioner.environments_folders).first
60
- source_path = "#{VagrantPlugins::WinAzure.source_root}"
61
- template_path = source_path + "/templates/provisioners/chef-solo/solo"
62
- setup_config(template_path, "solo.rb", {
63
- :cookbooks_path => cookbooks_path,
64
- :recipe_url => config.recipe_url,
65
- :roles_path => roles_path,
66
- :data_bags_path => data_bags_path,
67
- :environments_path => environments_path
68
- })
69
- end
70
-
71
- def setup_config(template, filename, template_vars)
72
- # If we have custom configuration, upload it
73
- remote_custom_config_path = nil
74
- if config.custom_config_path
75
- expanded = File.expand_path(
76
- config.custom_config_path, @machine.env.root_path)
77
- remote_custom_config_path = File.join(
78
- config.provisioning_path, "custom-config.rb")
79
-
80
- @env[:machine].provider.driver.upload(expanded, remote_custom_config_path)
81
- end
82
-
83
- config_file = Vagrant::Util::TemplateRenderer.render(template, {
84
- :custom_configuration => remote_custom_config_path,
85
- :file_cache_path => config.file_cache_path,
86
- :file_backup_path => config.file_backup_path,
87
- :log_level => config.log_level.to_sym,
88
- :verbose_logging => config.verbose_logging,
89
- :http_proxy => config.http_proxy,
90
- :http_proxy_user => config.http_proxy_user,
91
- :http_proxy_pass => config.http_proxy_pass,
92
- :https_proxy => config.https_proxy,
93
- :https_proxy_user => config.https_proxy_user,
94
- :https_proxy_pass => config.https_proxy_pass,
95
- :no_proxy => config.no_proxy,
96
- :formatter => config.formatter
97
- }.merge(template_vars))
98
-
99
- # Create a temporary file to store the data so we can upload it
100
- temp = Tempfile.new("vagrant")
101
- temp.write(config_file)
102
- temp.close
103
-
104
- remote_file = File.join(config.provisioning_path, filename)
105
- @env[:machine].provider.driver.upload(temp.path, remote_file)
106
- end
107
-
108
- def run_chef_solo
109
- if config.run_list && config.run_list.empty?
110
- @env[:machine].ui.warn(I18n.t("vagrant.chef_run_list_empty"))
111
- end
112
-
113
- options = [
114
- "-c #{config.provisioning_path}/solo.rb",
115
- "-j #{config.provisioning_path}/dna.json"
116
- ]
117
-
118
- command_env = config.binary_env ? "#{config.binary_env} " : ""
119
- command_args = config.arguments ? " #{config.arguments}" : ""
120
- command = "#{command_env}#{chef_binary_path("chef-solo")} " +
121
- "#{options.join(" ")} #{command_args}"
122
- config.attempts.times do |attempt|
123
- if attempt == 0
124
- @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.running_solo")
125
- else
126
- @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.running_solo_again")
127
- end
128
-
129
- command
130
-
131
- @env[:machine].provider.driver.run_remote_ps(command) do |type, data|
132
- # Output the data with the proper color based on the stream.
133
- if (type == :stdout || type == :stderr)
134
- @env[:ui].detail data
135
- end
136
- end
137
- end
138
-
139
- end
140
-
141
- def upload_encrypted_data_bag_secret
142
- @machine.env.ui.info I18n.t("vagrant.provisioners.chef.upload_encrypted_data_bag_secret_key")
143
- @env[:machine].provider.driver.upload(encrypted_data_bag_secret_key_path,
144
- config.encrypted_data_bag_secret)
145
- end
146
-
147
- def encrypted_data_bag_secret_key_path
148
- File.expand_path(config.encrypted_data_bag_secret_key_path, @env[:machine].env.root_path)
149
- end
150
-
151
- def config
152
- provisioner.config
153
- end
154
-
155
- def guest_paths(folders)
156
- folders.map { |parts| parts[2] }
157
- end
158
-
159
- # Returns the path to the Chef binary, taking into account the
160
- # `binary_path` configuration option.
161
- def chef_binary_path(binary)
162
- return binary if !config.binary_path
163
- return File.join(config.binary_path, binary)
164
- end
165
-
166
- def copy_folder_to_guest(folders)
167
- folders.each do |type, local_path, remote_path|
168
- if type == :host
169
- @env[:machine].provider.driver.upload(local_path, remote_path)
170
- end
171
- end
172
- end
173
-
174
- end
175
- end
176
- end
177
- 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
+
7
+ require "fileutils"
8
+ require "tempfile"
9
+
10
+ module VagrantPlugins
11
+ module WinAzure
12
+ module Provisioner
13
+ class ChefSolo
14
+ attr_reader :provisioner
15
+
16
+ def initialize(env)
17
+ @env = env
18
+ @provisioner = env[:provisioner]
19
+ end
20
+
21
+ def provision_for_windows
22
+ # Copy the chef cookbooks roles data bags and environment folders to Guest
23
+ copy_folder_to_guest(provisioner.cookbook_folders)
24
+ copy_folder_to_guest(provisioner.role_folders)
25
+ copy_folder_to_guest(provisioner.data_bags_folders)
26
+ copy_folder_to_guest(provisioner.environments_folders)
27
+
28
+ # Upload Encrypted data bag
29
+ upload_encrypted_data_bag_secret if config.encrypted_data_bag_secret_key_path
30
+ setup_json
31
+ setup_solo_config
32
+ run_chef_solo
33
+
34
+ # TODO
35
+ # delete_encrypted_data_bag_secret
36
+ end
37
+
38
+ def setup_json
39
+ @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.json")
40
+
41
+ # Get the JSON that we're going to expose to Chef
42
+ json = config.json
43
+ json[:run_list] = config.run_list if !config.run_list.empty?
44
+ json = JSON.pretty_generate(json)
45
+
46
+ # Create a temporary file to store the data so we
47
+ # can upload it
48
+ temp = Tempfile.new("vagrant")
49
+ temp.write(json)
50
+ temp.close
51
+
52
+ remote_file = File.join(config.provisioning_path, "dna.json")
53
+ @env[:machine].provider.driver.upload(temp.path, remote_file)
54
+ end
55
+
56
+ def setup_solo_config
57
+ cookbooks_path = guest_paths(provisioner.cookbook_folders)
58
+ roles_path = guest_paths(provisioner.role_folders)
59
+ data_bags_path = guest_paths(provisioner.data_bags_folders).first
60
+ environments_path = guest_paths(provisioner.environments_folders).first
61
+ source_path = "#{VagrantPlugins::WinAzure.source_root}"
62
+ template_path = source_path + "/templates/provisioners/chef-solo/solo"
63
+ setup_config(template_path, "solo.rb", {
64
+ :cookbooks_path => cookbooks_path,
65
+ :recipe_url => config.recipe_url,
66
+ :roles_path => roles_path,
67
+ :data_bags_path => data_bags_path,
68
+ :environments_path => environments_path
69
+ })
70
+ end
71
+
72
+ def setup_config(template, filename, template_vars)
73
+ # If we have custom configuration, upload it
74
+ remote_custom_config_path = nil
75
+ if config.custom_config_path
76
+ expanded = File.expand_path(
77
+ config.custom_config_path, @machine.env.root_path)
78
+ remote_custom_config_path = File.join(
79
+ config.provisioning_path, "custom-config.rb")
80
+
81
+ @env[:machine].provider.driver.upload(expanded, remote_custom_config_path)
82
+ end
83
+
84
+ config_file = Vagrant::Util::TemplateRenderer.render(template, {
85
+ :custom_configuration => remote_custom_config_path,
86
+ :file_cache_path => config.file_cache_path,
87
+ :file_backup_path => config.file_backup_path,
88
+ :log_level => config.log_level.to_sym,
89
+ :verbose_logging => config.verbose_logging,
90
+ :http_proxy => config.http_proxy,
91
+ :http_proxy_user => config.http_proxy_user,
92
+ :http_proxy_pass => config.http_proxy_pass,
93
+ :https_proxy => config.https_proxy,
94
+ :https_proxy_user => config.https_proxy_user,
95
+ :https_proxy_pass => config.https_proxy_pass,
96
+ :no_proxy => config.no_proxy,
97
+ :formatter => config.formatter
98
+ }.merge(template_vars))
99
+
100
+ # Create a temporary file to store the data so we can upload it
101
+ temp = Tempfile.new("vagrant")
102
+ temp.write(config_file)
103
+ temp.close
104
+
105
+ remote_file = File.join(config.provisioning_path, filename)
106
+ @env[:machine].provider.driver.upload(temp.path, remote_file)
107
+ end
108
+
109
+ def run_chef_solo
110
+ if config.run_list && config.run_list.empty?
111
+ @env[:machine].ui.warn(I18n.t("vagrant.chef_run_list_empty"))
112
+ end
113
+
114
+ options = [
115
+ "-c #{config.provisioning_path}/solo.rb",
116
+ "-j #{config.provisioning_path}/dna.json"
117
+ ]
118
+
119
+ command_env = config.binary_env ? "#{config.binary_env} " : ""
120
+ command_args = config.arguments ? " #{config.arguments}" : ""
121
+ command = "#{command_env}#{chef_binary_path("chef-solo")} " +
122
+ "#{options.join(" ")} #{command_args}"
123
+ config.attempts.times do |attempt|
124
+ if attempt == 0
125
+ @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.running_solo")
126
+ else
127
+ @env[:machine].env.ui.info I18n.t("vagrant.provisioners.chef.running_solo_again")
128
+ end
129
+
130
+ command
131
+
132
+ @env[:machine].provider.driver.run_remote_ps(command) do |type, data|
133
+ # Output the data with the proper color based on the stream.
134
+ if (type == :stdout || type == :stderr)
135
+ @env[:ui].detail data
136
+ end
137
+ end
138
+ end
139
+
140
+ end
141
+
142
+ def upload_encrypted_data_bag_secret
143
+ @machine.env.ui.info I18n.t("vagrant.provisioners.chef.upload_encrypted_data_bag_secret_key")
144
+ @env[:machine].provider.driver.upload(encrypted_data_bag_secret_key_path,
145
+ config.encrypted_data_bag_secret)
146
+ end
147
+
148
+ def encrypted_data_bag_secret_key_path
149
+ File.expand_path(config.encrypted_data_bag_secret_key_path, @env[:machine].env.root_path)
150
+ end
151
+
152
+ def config
153
+ provisioner.config
154
+ end
155
+
156
+ def guest_paths(folders)
157
+ folders.map { |parts| parts[2] }
158
+ end
159
+
160
+ # Returns the path to the Chef binary, taking into account the
161
+ # `binary_path` configuration option.
162
+ def chef_binary_path(binary)
163
+ return binary if !config.binary_path
164
+ return File.join(config.binary_path, binary)
165
+ end
166
+
167
+ def copy_folder_to_guest(folders)
168
+ folders.each do |type, local_path, remote_path|
169
+ if type == :host
170
+ @env[:machine].provider.driver.upload(local_path, remote_path)
171
+ end
172
+ end
173
+ end
174
+
175
+ end
176
+ end
177
+ end
178
+ end
@@ -1,115 +1,116 @@
1
- #---------------------------------------------------------------------------
2
- # Copyright (c) Microsoft Open Technologies, Inc.
3
- # All Rights Reserved. Licensed under the Apache 2.0 License.
4
- #---------------------------------------------------------------------------
5
- require 'fileutils'
6
- require 'tempfile'
7
-
8
- module VagrantPlugins
9
- module WinAzure
10
- module Provisioner
11
- class Puppet
12
- attr_reader :provisioner
13
-
14
- def initialize(env)
15
- @env = env
16
- @provisioner = env[:provisioner]
17
- end
18
-
19
- def provision_for_windows
20
- options = [config.options].flatten
21
- @module_paths = provisioner.instance_variable_get('@module_paths')
22
- @hiera_config_path = provisioner.instance_variable_get(
23
- '@hiera_config_path'
24
- )
25
- @manifest_file = provisioner.instance_variable_get('@manifest_file')
26
-
27
- # Copy the manifests directory to the guest
28
- if config.manifests_path[0].to_sym == :host
29
- @env[:machine].provider.driver.upload(
30
- File.expand_path(
31
- config.manifests_path[1], @env[:machine].env.root_path
32
- ),
33
- provisioner.manifests_guest_path
34
- )
35
- end
36
-
37
- # Copy the module paths to the guest
38
- @module_paths.each do |from, to|
39
- @env[:machine].provider.driver.upload(from.to_s, to)
40
- end
41
-
42
- module_paths = @module_paths.map { |_, to| to }
43
- unless module_paths.empty?
44
- win_paths = []
45
- # Prepend the default module path
46
- module_paths.unshift('/ProgramData/PuppetLabs/puppet/etc/modules')
47
- module_paths.each do |path|
48
- path = path.gsub('/', '\\')
49
- path = "C:#{path}" if path =~/^\\/
50
- win_paths << path
51
- end
52
-
53
- # Add the command line switch to add the module path
54
- options << "--modulepath \"#{win_paths.join(';')}\""
55
- end
56
-
57
- if @hiera_config_path
58
- options << "--hiera_config=#{@hiera_config_path}"
59
-
60
- # Upload Hiera configuration if we have it
61
- local_hiera_path = File.expand_path(
62
- config.hiera_config_path,
63
- @env[:machine].env.root_path
64
- )
65
-
66
- @env[:machine].provider.driver.upload(
67
- local_hiera_path,
68
- @hiera_config_path
69
- )
70
- end
71
-
72
- options << "--manifestdir #{provisioner.manifests_guest_path}"
73
- options << "--detailed-exitcodes"
74
- options << @manifest_file
75
- options = options.join(' ')
76
-
77
- # Build up the custome facts if we have any
78
- facter = ''
79
- unless config.facter.empty?
80
- facts = []
81
- config.facter.each do |key, value|
82
- facts << "FACTER_#{key}='#{value}'"
83
- end
84
-
85
- facter = "#{facts.join(' ')}"
86
- end
87
-
88
- command = "#{facter}puppet apply #{options}"
89
-
90
- if config.working_directory
91
- command = "cd #{config.working_directory} && #{command}"
92
- end
93
-
94
- @env[:ui].info I18n.t(
95
- 'vagrant.provisioners.puppet.running_puppet',
96
- manifest: config.manifest_file
97
- )
98
- @env[:ui].info 'Executing puppet script in Windows Azure VM'
99
- @env[:machine].provider.driver.run_remote_ps(command) do |type, data|
100
- # Output the data with the proper color based on the stream.
101
- if (type == :stdout || type == :stderr)
102
- @env[:ui].detail data
103
- end
104
- end
105
- end
106
-
107
- protected
108
-
109
- def config
110
- provisioner.config
111
- end
112
- end
113
- end
114
- end
115
- 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 'fileutils'
7
+ require 'tempfile'
8
+
9
+ module VagrantPlugins
10
+ module WinAzure
11
+ module Provisioner
12
+ class Puppet
13
+ attr_reader :provisioner
14
+
15
+ def initialize(env)
16
+ @env = env
17
+ @provisioner = env[:provisioner]
18
+ end
19
+
20
+ def provision_for_windows
21
+ options = [config.options].flatten
22
+ @module_paths = provisioner.instance_variable_get('@module_paths')
23
+ @hiera_config_path = provisioner.instance_variable_get(
24
+ '@hiera_config_path'
25
+ )
26
+ @manifest_file = provisioner.instance_variable_get('@manifest_file')
27
+
28
+ # Copy the manifests directory to the guest
29
+ if config.manifests_path[0].to_sym == :host
30
+ @env[:machine].provider.driver.upload(
31
+ File.expand_path(
32
+ config.manifests_path[1], @env[:machine].env.root_path
33
+ ),
34
+ provisioner.manifests_guest_path
35
+ )
36
+ end
37
+
38
+ # Copy the module paths to the guest
39
+ @module_paths.each do |from, to|
40
+ @env[:machine].provider.driver.upload(from.to_s, to)
41
+ end
42
+
43
+ module_paths = @module_paths.map { |_, to| to }
44
+ unless module_paths.empty?
45
+ win_paths = []
46
+ # Prepend the default module path
47
+ module_paths.unshift('/ProgramData/PuppetLabs/puppet/etc/modules')
48
+ module_paths.each do |path|
49
+ path = path.gsub('/', '\\')
50
+ path = "C:#{path}" if path =~/^\\/
51
+ win_paths << path
52
+ end
53
+
54
+ # Add the command line switch to add the module path
55
+ options << "--modulepath \"#{win_paths.join(';')}\""
56
+ end
57
+
58
+ if @hiera_config_path
59
+ options << "--hiera_config=#{@hiera_config_path}"
60
+
61
+ # Upload Hiera configuration if we have it
62
+ local_hiera_path = File.expand_path(
63
+ config.hiera_config_path,
64
+ @env[:machine].env.root_path
65
+ )
66
+
67
+ @env[:machine].provider.driver.upload(
68
+ local_hiera_path,
69
+ @hiera_config_path
70
+ )
71
+ end
72
+
73
+ options << "--manifestdir #{provisioner.manifests_guest_path}"
74
+ options << "--detailed-exitcodes"
75
+ options << @manifest_file
76
+ options = options.join(' ')
77
+
78
+ # Build up the custome facts if we have any
79
+ facter = ''
80
+ unless config.facter.empty?
81
+ facts = []
82
+ config.facter.each do |key, value|
83
+ facts << "FACTER_#{key}='#{value}'"
84
+ end
85
+
86
+ facter = "#{facts.join(' ')}"
87
+ end
88
+
89
+ command = "#{facter}puppet apply #{options}"
90
+
91
+ if config.working_directory
92
+ command = "cd #{config.working_directory} && #{command}"
93
+ end
94
+
95
+ @env[:ui].info I18n.t(
96
+ 'vagrant.provisioners.puppet.running_puppet',
97
+ manifest: config.manifest_file
98
+ )
99
+ @env[:ui].info 'Executing puppet script in Windows Azure VM'
100
+ @env[:machine].provider.driver.run_remote_ps(command) do |type, data|
101
+ # Output the data with the proper color based on the stream.
102
+ if (type == :stdout || type == :stderr)
103
+ @env[:ui].detail data
104
+ end
105
+ end
106
+ end
107
+
108
+ protected
109
+
110
+ def config
111
+ provisioner.config
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end