vagrant-windows-hyperv 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +15 -0
  4. data/LICENSE.txt +7 -0
  5. data/README.md +89 -0
  6. data/Rakefile +29 -0
  7. data/example_box/metadata.json +1 -0
  8. data/lib/vagrant-windows-hyperv.rb +38 -0
  9. data/lib/vagrant-windows-hyperv/action.rb +81 -0
  10. data/lib/vagrant-windows-hyperv/action/export.rb +54 -0
  11. data/lib/vagrant-windows-hyperv/action/package.rb +21 -0
  12. data/lib/vagrant-windows-hyperv/action/rdp.rb +49 -0
  13. data/lib/vagrant-windows-hyperv/action/setup_package_files.rb +55 -0
  14. data/lib/vagrant-windows-hyperv/command/rdp/command.rb +22 -0
  15. data/lib/vagrant-windows-hyperv/communication/powershell.rb +37 -0
  16. data/lib/vagrant-windows-hyperv/driver.rb +89 -0
  17. data/lib/vagrant-windows-hyperv/errors.rb +31 -0
  18. data/lib/vagrant-windows-hyperv/guest/cap/halt.rb +19 -0
  19. data/lib/vagrant-windows-hyperv/guest/windows.rb +25 -0
  20. data/lib/vagrant-windows-hyperv/monkey_patch/action/provision.rb +32 -0
  21. data/lib/vagrant-windows-hyperv/monkey_patch/machine.rb +22 -0
  22. data/lib/vagrant-windows-hyperv/monkey_patch/plugins/synced_folders/smb/synced_folders.rb +55 -0
  23. data/lib/vagrant-windows-hyperv/monkey_patch/util/powershell.rb +37 -0
  24. data/lib/vagrant-windows-hyperv/plugin.rb +85 -0
  25. data/lib/vagrant-windows-hyperv/provider.rb +30 -0
  26. data/lib/vagrant-windows-hyperv/provisioner/chef_solo.rb +181 -0
  27. data/lib/vagrant-windows-hyperv/provisioner/puppet.rb +99 -0
  28. data/lib/vagrant-windows-hyperv/provisioner/shell.rb +81 -0
  29. data/lib/vagrant-windows-hyperv/scripts/check_winrm.ps1 +41 -0
  30. data/lib/vagrant-windows-hyperv/scripts/export_vm.ps1 +31 -0
  31. data/lib/vagrant-windows-hyperv/scripts/file_sync.ps1 +145 -0
  32. data/lib/vagrant-windows-hyperv/scripts/host_info.ps1 +25 -0
  33. data/lib/vagrant-windows-hyperv/scripts/hyperv_manager.ps1 +36 -0
  34. data/lib/vagrant-windows-hyperv/scripts/run_in_remote.ps1 +31 -0
  35. data/lib/vagrant-windows-hyperv/scripts/upload_file.ps1 +95 -0
  36. data/lib/vagrant-windows-hyperv/scripts/utils/create_session.ps1 +34 -0
  37. data/lib/vagrant-windows-hyperv/scripts/utils/write_messages.ps1 +18 -0
  38. data/lib/vagrant-windows-hyperv/version.rb +10 -0
  39. data/locales/en.yml +15 -0
  40. data/spec/hyper-v/config_spec.rb +36 -0
  41. data/spec/hyper-v/spec_helper.rb +9 -0
  42. data/templates/provisioners/chef-solo/solo.erb +51 -0
  43. data/vagrant-windows-hyperv.gemspec +63 -0
  44. data/vagrantfile_examples/Vagrantfile_linux +23 -0
  45. data/vagrantfile_examples/Vagrantfile_windows +24 -0
  46. metadata +171 -0
@@ -0,0 +1,9 @@
1
+ #-------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache 2.0 License.
4
+ #--------------------------------------------------------------------------
5
+
6
+ require "minitest/autorun"
7
+ require 'mocha/setup'
8
+ require "minitest/reporters"
9
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
@@ -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 -%>
@@ -0,0 +1,63 @@
1
+ #-------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache 2.0 License.
4
+ #--------------------------------------------------------------------------
5
+ # coding: utf-8
6
+ lib = File.expand_path('../lib', __FILE__)
7
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
8
+ require 'vagrant-windows-hyperv/version'
9
+
10
+ Gem::Specification.new do |spec|
11
+ spec.name = "vagrant-windows-hyperv"
12
+ spec.version = VagrantPlugins::VagrantHyperV::VERSION
13
+ spec.authors = ["MSOpenTech"]
14
+ spec.description = "Windows guest support for Hyper-V"
15
+ spec.summary = "Enable Vagrant to manage Windows Virtual Machine created using Hyper-V"
16
+ spec.homepage = "https://github.com/MSOpenTech/Vagrant-Windows-Hyperv"
17
+ spec.license = "Apache 2.0"
18
+ spec.required_rubygems_version = ">= 2.0.0"
19
+
20
+ spec.require_paths = ["lib"]
21
+
22
+ # The following block of code determines the files that should be included
23
+ # in the gem. It does this by reading all the files in the directory where
24
+ # this gemspec is, and parsing out the ignored files from the gitignore.
25
+ # Note that the entire gitignore(5) syntax is not supported, specifically
26
+ # the "!" syntax, but it should mostly work correctly.
27
+ root_path = File.dirname(__FILE__)
28
+ all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
29
+ all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
30
+ gitignore_path = File.join(root_path, ".gitignore")
31
+ gitignore = File.readlines(gitignore_path)
32
+ gitignore.map! { |line| line.chomp.strip }
33
+ gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
34
+
35
+ unignored_files = all_files.reject do |file|
36
+ # Ignore any directories, the gemspec only cares about files
37
+ next true if File.directory?(file)
38
+
39
+ # Ignore any paths that match anything in the gitignore. We do
40
+ # two tests here:
41
+ #
42
+ # - First, test to see if the entire path matches the gitignore.
43
+ # - Second, match if the basename does, this makes it so that things
44
+ # like '.DS_Store' will match sub-directories too (same behavior
45
+ # as git).
46
+ #
47
+ gitignore.any? do |ignore|
48
+ File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
49
+ File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
50
+ end
51
+ end
52
+
53
+ spec.files = unignored_files
54
+ spec.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
55
+
56
+ spec.add_runtime_dependency "json"
57
+
58
+ spec.add_development_dependency "bundler", "~> 1.3"
59
+ spec.add_development_dependency "rake"
60
+ spec.add_development_dependency "minitest"
61
+ spec.add_development_dependency "minitest-reporters"
62
+ spec.add_development_dependency "mocha"
63
+ end
@@ -0,0 +1,23 @@
1
+ #-------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache 2.0 License.
4
+ #--------------------------------------------------------------------------
5
+ # -*- mode: ruby -*-
6
+ # vi: set ft=ruby :
7
+
8
+ VAGRANTFILE_API_VERSION = "2"
9
+
10
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
11
+
12
+ config.vm.box = "ubuntu-13-10"
13
+
14
+ config.vm.synced_folder 'E:/my_project', "/home/vagrant/my_project"
15
+
16
+ # Example to use disable option
17
+ config.vm.synced_folder "." , "/vagrant", :disabled => true
18
+
19
+ config.vm.provider "hyperv" do |hv, override|
20
+ override.ssh.username = "vagrant"
21
+ override.ssh.private_key_path = "E:/insecure_private_key"
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ #-------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Open Technologies, Inc.
3
+ # All Rights Reserved. Licensed under the Apache 2.0 License.
4
+ #--------------------------------------------------------------------------
5
+ # -*- mode: ruby -*-
6
+ # vi: set ft=ruby :
7
+
8
+ VAGRANTFILE_API_VERSION = "2"
9
+
10
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
11
+
12
+ config.vm.box = "hyperv-win8"
13
+
14
+ config.vm.synced_folder 'E:/my_project', "C:/Users/vagrant/my_project"
15
+
16
+ # Example to use disable option
17
+ config.vm.synced_folder "." , "/vagrant", :disabled => true
18
+
19
+ config.vm.guest = :windows
20
+
21
+ config.vm.provider "hyperv" do |hv, override|
22
+ override.ssh.username = "vagrant"
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,171 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-windows-hyperv
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - MSOpenTech
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-reporters
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mocha
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Windows guest support for Hyper-V
98
+ email:
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - example_box/metadata.json
104
+ - Gemfile
105
+ - lib/vagrant-windows-hyperv/action/export.rb
106
+ - lib/vagrant-windows-hyperv/action/package.rb
107
+ - lib/vagrant-windows-hyperv/action/rdp.rb
108
+ - lib/vagrant-windows-hyperv/action/setup_package_files.rb
109
+ - lib/vagrant-windows-hyperv/action.rb
110
+ - lib/vagrant-windows-hyperv/command/rdp/command.rb
111
+ - lib/vagrant-windows-hyperv/communication/powershell.rb
112
+ - lib/vagrant-windows-hyperv/driver.rb
113
+ - lib/vagrant-windows-hyperv/errors.rb
114
+ - lib/vagrant-windows-hyperv/guest/cap/halt.rb
115
+ - lib/vagrant-windows-hyperv/guest/windows.rb
116
+ - lib/vagrant-windows-hyperv/monkey_patch/action/provision.rb
117
+ - lib/vagrant-windows-hyperv/monkey_patch/machine.rb
118
+ - lib/vagrant-windows-hyperv/monkey_patch/plugins/synced_folders/smb/synced_folders.rb
119
+ - lib/vagrant-windows-hyperv/monkey_patch/util/powershell.rb
120
+ - lib/vagrant-windows-hyperv/plugin.rb
121
+ - lib/vagrant-windows-hyperv/provider.rb
122
+ - lib/vagrant-windows-hyperv/provisioner/chef_solo.rb
123
+ - lib/vagrant-windows-hyperv/provisioner/puppet.rb
124
+ - lib/vagrant-windows-hyperv/provisioner/shell.rb
125
+ - lib/vagrant-windows-hyperv/scripts/check_winrm.ps1
126
+ - lib/vagrant-windows-hyperv/scripts/export_vm.ps1
127
+ - lib/vagrant-windows-hyperv/scripts/file_sync.ps1
128
+ - lib/vagrant-windows-hyperv/scripts/host_info.ps1
129
+ - lib/vagrant-windows-hyperv/scripts/hyperv_manager.ps1
130
+ - lib/vagrant-windows-hyperv/scripts/run_in_remote.ps1
131
+ - lib/vagrant-windows-hyperv/scripts/upload_file.ps1
132
+ - lib/vagrant-windows-hyperv/scripts/utils/create_session.ps1
133
+ - lib/vagrant-windows-hyperv/scripts/utils/write_messages.ps1
134
+ - lib/vagrant-windows-hyperv/version.rb
135
+ - lib/vagrant-windows-hyperv.rb
136
+ - LICENSE.txt
137
+ - locales/en.yml
138
+ - Rakefile
139
+ - README.md
140
+ - spec/hyper-v/config_spec.rb
141
+ - spec/hyper-v/spec_helper.rb
142
+ - templates/provisioners/chef-solo/solo.erb
143
+ - vagrant-windows-hyperv.gemspec
144
+ - vagrantfile_examples/Vagrantfile_linux
145
+ - vagrantfile_examples/Vagrantfile_windows
146
+ - .gitignore
147
+ homepage: https://github.com/MSOpenTech/Vagrant-Windows-Hyperv
148
+ licenses:
149
+ - Apache 2.0
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - '>='
163
+ - !ruby/object:Gem::Version
164
+ version: 2.0.0
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 2.0.14
168
+ signing_key:
169
+ specification_version: 4
170
+ summary: Enable Vagrant to manage Windows Virtual Machine created using Hyper-V
171
+ test_files: []