vagrant-azure 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,83 @@
1
+ #---------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache 2.0 License.
4
+ #---------------------------------------------------------------------------
5
+ module VagrantPlugins
6
+ module WinAzure
7
+ module Provisioner
8
+ class Shell
9
+ attr_reader :provisioner
10
+
11
+ def initialize(env)
12
+ @env = env
13
+ @provisioner = env[:provisioner]
14
+ end
15
+
16
+ def provision_for_windows
17
+ arguments = ''
18
+ arguments = "#{config.args}" if config.args
19
+
20
+ with_windows_script_file do |path|
21
+ guest_path = if File.extname(config.upload_path) == ''
22
+ "#{config.upload_path}#{File.extname(path.to_s)}"
23
+ else
24
+ config.upload_path
25
+ end
26
+
27
+ @env[:ui].detail "Uploading [#{path}] to [#{guest_path}]"
28
+
29
+ response = @env[:machine].provider.driver.upload(path, guest_path)
30
+
31
+ command = "powershell.exe #{guest_path} #{arguments}"
32
+ @env[:machine].provider.driver.run_remote_ps(
33
+ command
34
+ ) do |type, data|
35
+ if type == :stdout || type == :stderr
36
+ @env[:ui].detail data
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ protected
43
+
44
+ def config
45
+ provisioner.config
46
+ end
47
+
48
+ def with_windows_script_file
49
+ if config.remote?
50
+ download_path = @env[:machine].env.tmp_path.join(
51
+ "#{env[:mahine].id}-remote-script#{File.extname(config.path)}"
52
+ )
53
+
54
+ download_path.delete if download_path.file?
55
+
56
+ begin
57
+ Vagrant::Util::Downloader.new(
58
+ config.path, download_path
59
+ ).download!
60
+ yield download_path
61
+ ensure
62
+ download_path.delete
63
+ end
64
+ elsif config.path
65
+ yield config.path
66
+ else
67
+ # We have an inline script. Create a temp file and handle it.
68
+ file = Tempfile.new(['vagrant-powershell', '.ps1'])
69
+
70
+ begin
71
+ file.write(config.inline)
72
+ file.fsync
73
+ file.close
74
+ yield file.path
75
+ ensure
76
+ file.close
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module VagrantPlugins
7
7
  module WinAzure
8
- VERSION = '1.0.3'
8
+ VERSION = '1.0.4'
9
9
  end
10
10
  end
@@ -12,3 +12,5 @@ en:
12
12
  RDP not ready
13
13
  vm_started: |-
14
14
  VM '%{name}' has been started
15
+ vm_stopped: |-
16
+ VM '%{name}' has been stopped
@@ -0,0 +1,51 @@
1
+ require 'chef/version_constraint'
2
+
3
+ <% if node_name %>
4
+ node_name "<%= node_name %>"
5
+ <% end %>
6
+ file_cache_path "<%= file_cache_path %>"
7
+ file_backup_path "<%= file_backup_path %>"
8
+ cookbook_path <%= cookbooks_path.inspect %>
9
+ <% if roles_path %>
10
+ if Chef::VersionConstraint.new("< 11.8.0").include?(Chef::VERSION)
11
+ role_path <%= roles_path.first.inspect %>
12
+ else
13
+ role_path <%= roles_path.inspect %>
14
+ end
15
+ <% end %>
16
+ log_level <%= log_level.inspect %>
17
+ verbose_logging <%= verbose_logging.inspect %>
18
+
19
+ encrypted_data_bag_secret <%= encrypted_data_bag_secret.inspect %>
20
+
21
+ <% if data_bags_path -%>
22
+ data_bag_path <%= data_bags_path.inspect %>
23
+ <% end %>
24
+
25
+ <% if recipe_url -%>
26
+ recipe_url "<%= recipe_url %>"
27
+ <% end -%>
28
+
29
+ <% if environments_path %>
30
+ environment_path <%= environments_path.inspect %>
31
+ <% end -%>
32
+
33
+ <% if environment %>
34
+ environment "<%= environment %>"
35
+ <% end -%>
36
+
37
+ http_proxy <%= http_proxy.inspect %>
38
+ http_proxy_user <%= http_proxy_user.inspect %>
39
+ http_proxy_pass <%= http_proxy_pass.inspect %>
40
+ https_proxy <%= https_proxy.inspect %>
41
+ https_proxy_user <%= https_proxy_user.inspect %>
42
+ https_proxy_pass <%= https_proxy_pass.inspect %>
43
+ no_proxy <%= no_proxy.inspect %>
44
+
45
+ <% if formatter %>
46
+ add_formatter "<%= formatter %>"
47
+ <% end %>
48
+
49
+ <% if custom_configuration -%>
50
+ Chef::Config.from_file "<%= custom_configuration %>"
51
+ <% end -%>
@@ -1,58 +1,58 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'vagrant-azure/version'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "vagrant-azure"
8
- s.version = VagrantPlugins::WinAzure::VERSION
9
- s.authors = ["MSOpenTech"]
10
- s.description = "Enable Vagrant to manage machines in Azure"
11
- s.summary = "Enable Vagrant to manage machines in Azure"
12
- s.homepage = "https://github.com/MSOpenTech/vagrant-azure"
13
- s.license = "Apache 2.0"
14
-
15
- s.require_paths = ["lib"]
16
-
17
- # The following block of code determines the files that should be included
18
- # in the gem. It does this by reading all the files in the directory where
19
- # this gemspec is, and parsing out the ignored files from the gitignore.
20
- # Note that the entire gitignore(5) syntax is not supported, specifically
21
- # the "!" syntax, but it should mostly work correctly.
22
- root_path = File.dirname(__FILE__)
23
- all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
24
- all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
25
- gitignore_path = File.join(root_path, ".gitignore")
26
- gitignore = File.readlines(gitignore_path)
27
- gitignore.map! { |line| line.chomp.strip }
28
- gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
29
-
30
- unignored_files = all_files.reject do |file|
31
- # Ignore any directories, the gemspec only cares about files
32
- next true if File.directory?(file)
33
-
34
- # Ignore any paths that match anything in the gitignore. We do
35
- # two tests here:
36
- #
37
- # - First, test to see if the entire path matches the gitignore.
38
- # - Second, match if the basename does, this makes it so that things
39
- # like '.DS_Store' will match sub-directories too (same behavior
40
- # as git).
41
- #
42
- gitignore.any? do |ignore|
43
- File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
44
- File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
45
- end
46
- end
47
-
48
- s.files = unignored_files
49
- s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
50
-
51
- s.add_runtime_dependency "azure", "0.6.3"
52
-
53
- s.add_development_dependency "bundler", "~> 1.3"
54
- s.add_development_dependency "rake"
55
- s.add_development_dependency "minitest"
56
- s.add_development_dependency "minitest-reporters"
57
- s.add_development_dependency "mocha"
58
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-azure/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "vagrant-azure"
8
+ s.version = VagrantPlugins::WinAzure::VERSION
9
+ s.authors = ["MSOpenTech"]
10
+ s.description = "Enable Vagrant to manage machines in Azure"
11
+ s.summary = "Enable Vagrant to manage machines in Azure"
12
+ s.homepage = "https://github.com/MSOpenTech/vagrant-azure"
13
+ s.license = "Apache 2.0"
14
+
15
+ s.require_paths = ["lib"]
16
+
17
+ # The following block of code determines the files that should be included
18
+ # in the gem. It does this by reading all the files in the directory where
19
+ # this gemspec is, and parsing out the ignored files from the gitignore.
20
+ # Note that the entire gitignore(5) syntax is not supported, specifically
21
+ # the "!" syntax, but it should mostly work correctly.
22
+ root_path = File.dirname(__FILE__)
23
+ all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
24
+ all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
25
+ gitignore_path = File.join(root_path, ".gitignore")
26
+ gitignore = File.readlines(gitignore_path)
27
+ gitignore.map! { |line| line.chomp.strip }
28
+ gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
29
+
30
+ unignored_files = all_files.reject do |file|
31
+ # Ignore any directories, the gemspec only cares about files
32
+ next true if File.directory?(file)
33
+
34
+ # Ignore any paths that match anything in the gitignore. We do
35
+ # two tests here:
36
+ #
37
+ # - First, test to see if the entire path matches the gitignore.
38
+ # - Second, match if the basename does, this makes it so that things
39
+ # like '.DS_Store' will match sub-directories too (same behavior
40
+ # as git).
41
+ #
42
+ gitignore.any? do |ignore|
43
+ File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
44
+ File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
45
+ end
46
+ end
47
+
48
+ s.files = unignored_files
49
+ s.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
50
+
51
+ s.add_runtime_dependency "azure", "0.6.3"
52
+
53
+ s.add_development_dependency "bundler", "~> 1.3"
54
+ s.add_development_dependency "rake"
55
+ s.add_development_dependency "minitest"
56
+ s.add_development_dependency "minitest-reporters"
57
+ s.add_development_dependency "mocha"
58
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MSOpenTech
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-03 00:00:00.000000000 Z
11
+ date: 2014-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure
@@ -100,8 +100,9 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
+ - dummy.box
103
104
  - example_box/metadata.json
104
- - example_box/vagbuntu.box
105
+ - example_box/README.md
105
106
  - Gemfile
106
107
  - lib/vagrant-azure/action/connect_azure.rb
107
108
  - lib/vagrant-azure/action/provision.rb
@@ -120,7 +121,9 @@ files:
120
121
  - lib/vagrant-azure/driver.rb
121
122
  - lib/vagrant-azure/plugin.rb
122
123
  - lib/vagrant-azure/provider.rb
124
+ - lib/vagrant-azure/provisioner/chef-solo.rb
123
125
  - lib/vagrant-azure/provisioner/puppet.rb
126
+ - lib/vagrant-azure/provisioner/shell.rb
124
127
  - lib/vagrant-azure/scripts/check_winrm.ps1
125
128
  - lib/vagrant-azure/scripts/export_vm.ps1
126
129
  - lib/vagrant-azure/scripts/file_sync.ps1
@@ -134,43 +137,10 @@ files:
134
137
  - lib/vagrant-azure.rb
135
138
  - LICENSE
136
139
  - locales/en.yml
137
- - manifests/site.pp
138
- - manifests/sites.pp
139
- - modules/regsitry/acceptance/lib/systest/util/registry.rb
140
- - modules/regsitry/acceptance/lib/systest/util.rb
141
- - modules/regsitry/acceptance/lib/systest.rb
142
- - modules/regsitry/acceptance/tests/resource/registry/should_create_key.rb
143
- - modules/regsitry/acceptance/tests/resource/registry/should_have_defined_type.rb
144
- - modules/regsitry/acceptance/tests/resource/registry/should_manage_values.rb
145
- - modules/regsitry/acceptance/tests/resource/registry/should_pluginsync.rb
146
- - modules/regsitry/acceptance/tests/resource/registry/should_tolerate_mixed_case.rb
147
- - modules/regsitry/CHANGELOG.md
148
- - modules/regsitry/lib/puppet/provider/registry_key/registry.rb
149
- - modules/regsitry/lib/puppet/provider/registry_value/registry.rb
150
- - modules/regsitry/lib/puppet/type/registry_key.rb
151
- - modules/regsitry/lib/puppet/type/registry_value.rb
152
- - modules/regsitry/lib/puppet_x/puppetlabs/registry/provider_base.rb
153
- - modules/regsitry/lib/puppet_x/puppetlabs/registry.rb
154
- - modules/regsitry/LICENSE
155
- - modules/regsitry/manifests/compliance_example.pp
156
- - modules/regsitry/manifests/init.pp
157
- - modules/regsitry/manifests/purge_example.pp
158
- - modules/regsitry/manifests/service.pp
159
- - modules/regsitry/manifests/service_example.pp
160
- - modules/regsitry/manifests/value.pp
161
- - modules/regsitry/metadata.json
162
- - modules/regsitry/Modulefile
163
- - modules/regsitry/Rakefile
164
- - modules/regsitry/README.markdown
165
- - modules/regsitry/spec/spec_helper.rb
166
- - modules/regsitry/spec/unit/puppet/type/registry_key_spec.rb
167
- - modules/regsitry/spec/unit/puppet/type/registry_value_spec.rb
168
- - modules/regsitry/spec/watchr.rb
169
- - modules/regsitry/tests/init.pp
170
- - modules/regsitry/tests/registry_examples.pp
171
- - pkg/vagrant-azure-1.0.3.gem
140
+ - pkg/vagrant-azure-1.0.4.gem
172
141
  - Rakefile
173
142
  - README.md
143
+ - templates/provisioners/chef-solo/solo.erb
174
144
  - vagrant-azure.gemspec
175
145
  - .gitignore
176
146
  homepage: https://github.com/MSOpenTech/vagrant-azure