vagrant-azure 2.0.0.pre7 → 2.0.0.pre8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +120 -0
  4. data/.travis.yml +13 -0
  5. data/Gemfile +4 -5
  6. data/README.md +98 -57
  7. data/docs/basic_linux/Vagrantfile +17 -0
  8. data/docs/basic_linux/readme.md +12 -0
  9. data/docs/basic_windows/Vagrantfile +20 -0
  10. data/docs/basic_windows/readme.md +12 -0
  11. data/docs/custom_vhd/Vagrantfile +16 -0
  12. data/docs/custom_vhd/readme.md +48 -0
  13. data/docs/data_disks/Vagrantfile +16 -0
  14. data/docs/data_disks/readme.md +20 -0
  15. data/docs/managed_image/Vagrantfile +15 -0
  16. data/docs/managed_image/readme.md +66 -0
  17. data/docs/readme.md +30 -0
  18. data/lib/vagrant-azure/action/run_instance.rb +95 -69
  19. data/lib/vagrant-azure/config.rb +75 -4
  20. data/lib/vagrant-azure/util/machine_id_helper.rb +4 -0
  21. data/lib/vagrant-azure/util/managed_image_helper.rb +26 -0
  22. data/lib/vagrant-azure/util/template_renderer.rb +54 -0
  23. data/lib/vagrant-azure/util/timer.rb +4 -0
  24. data/lib/vagrant-azure/util/vm_await.rb +4 -0
  25. data/lib/vagrant-azure/util/vm_status_translator.rb +4 -0
  26. data/lib/vagrant-azure/version.rb +1 -1
  27. data/locales/en.yml +6 -0
  28. data/spec/spec_helper.rb +1 -0
  29. data/spec/templates/arm/deployment_spec.rb +169 -0
  30. data/spec/vagrant-azure/config_spec.rb +3 -3
  31. data/templates/arm/deployment.json.erb +50 -258
  32. data/templates/arm/resources/availability_set.json.erb +6 -0
  33. data/templates/arm/resources/data_disk.json.erb +21 -0
  34. data/templates/arm/resources/import_vhd_image.json.erb +23 -0
  35. data/templates/arm/resources/linux_reset_root_ext.json.erb +20 -0
  36. data/templates/arm/resources/network_interface.json.erb +26 -0
  37. data/templates/arm/resources/network_security_group.json.erb +85 -0
  38. data/templates/arm/resources/public_ip_address.json.erb +12 -0
  39. data/templates/arm/resources/storage_account.json.erb +9 -0
  40. data/templates/arm/resources/virtual_machine.json.erb +82 -0
  41. data/templates/arm/resources/virtual_network.json.erb +27 -0
  42. data/templates/arm/resources/windows_reset_access_ext.json.erb +21 -0
  43. data/vagrant-azure.gemspec +4 -6
  44. metadata +38 -40
  45. data/spec/vagrant-azure/services/azure_resource_manager_spec.rb +0 -19
@@ -0,0 +1,85 @@
1
+ {
2
+ "apiVersion": "2016-03-30",
3
+ "type": "Microsoft.Network/networkSecurityGroups",
4
+ "name": "[variables('networkSecurityGroupName')]",
5
+ "location": "[variables('location')]",
6
+ "properties": {
7
+ "securityRules": [
8
+ <% if operating_system == 'Windows' %>
9
+ {
10
+ "name": "rdp_rule",
11
+ "properties": {
12
+ "description": "Enable Inbound RDP",
13
+ "protocol": "Tcp",
14
+ "sourcePortRange": "*",
15
+ "destinationPortRange": "3389",
16
+ "sourceAddressPrefix": "*",
17
+ "destinationAddressPrefix": "*",
18
+ "access": "Allow",
19
+ "priority": 123,
20
+ "direction": "Inbound"
21
+ }
22
+ },
23
+ {
24
+ "name": "winrm_rule",
25
+ "properties": {
26
+ "description": "Enable Inbound WinRM",
27
+ "protocol": "Tcp",
28
+ "sourcePortRange": "*",
29
+ "destinationPortRange": "[parameters('winRmPort')]",
30
+ "sourceAddressPrefix": "*",
31
+ "destinationAddressPrefix": "*",
32
+ "access": "Allow",
33
+ "priority": 124,
34
+ "direction": "Inbound"
35
+ }
36
+ }
37
+ <% else %>
38
+ {
39
+ "name": "ssh_rule",
40
+ "properties": {
41
+ "description": "Enable inbound down to ssh default port 22.",
42
+ "protocol": "Tcp",
43
+ "sourcePortRange": "*",
44
+ "destinationPortRange": "22",
45
+ "sourceAddressPrefix": "*",
46
+ "destinationAddressPrefix": "*",
47
+ "access": "Allow",
48
+ "priority": 123,
49
+ "direction": "Inbound"
50
+ }
51
+ }
52
+ <% end %>
53
+ <% endpoints.each_with_index do |ports, index| %>
54
+ ,{
55
+ "name": "custom_rule_inbound_<%= index %>",
56
+ "properties": {
57
+ "description": "Enable inbound custom ports.",
58
+ "protocol": "*",
59
+ "sourcePortRange": "<%= ports %>",
60
+ "destinationPortRange": "<%= ports %>",
61
+ "sourceAddressPrefix": "*",
62
+ "destinationAddressPrefix": "*",
63
+ "access": "Allow",
64
+ "priority": <%= 133 + index %>,
65
+ "direction": "Inbound"
66
+ }
67
+ },
68
+ {
69
+ "name": "custom_rule_outbound_<%= index %>",
70
+ "properties": {
71
+ "description": "Enabled outbound custom ports.",
72
+ "protocol": "*",
73
+ "sourcePortRange": "<%= ports %>",
74
+ "destinationPortRange": "<%= ports %>",
75
+ "sourceAddressPrefix": "*",
76
+ "destinationAddressPrefix": "*",
77
+ "access": "Allow",
78
+ "priority": <%= 134 + index %>,
79
+ "direction": "Outbound"
80
+ }
81
+ }
82
+ <% end %>
83
+ ]
84
+ }
85
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "apiVersion": "2016-09-01",
3
+ "type": "Microsoft.Network/publicIPAddresses",
4
+ "name": "[variables('publicIPAddressName')]",
5
+ "location": "[variables('location')]",
6
+ "properties": {
7
+ "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
8
+ "dnsSettings": {
9
+ "domainNameLabel": "[parameters('dnsLabelPrefix')]"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "Microsoft.Storage/storageAccounts",
3
+ "name": "[variables('storageAccountName')]",
4
+ "apiVersion": "2016-12-01",
5
+ "location": "[variables('location')]",
6
+ "properties": {
7
+ "accountType": "[variables('storageAccountType')]"
8
+ }
9
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "apiVersion": "2016-04-30-preview",
3
+ "type": "Microsoft.Compute/virtualMachines",
4
+ "name": "[parameters('vmName')]",
5
+ "location": "[variables('location')]",
6
+ "dependsOn": [
7
+ <%= (depends_on || []).map{ |resource| "\"#{resource}\"" }.join(", ") %>
8
+ ],
9
+ <% if operating_system == 'Windows' %>
10
+ <%= self_signed_cert_resource %>
11
+ <% end %>
12
+ "properties": {
13
+ "hardwareProfile": {
14
+ "vmSize": "[parameters('vmSize')]"
15
+ },
16
+ "osProfile": {
17
+ "computerName": "[parameters('vmName')]",
18
+ "adminUsername": "[parameters('adminUsername')]",
19
+ <% if operating_system == 'Windows' %>
20
+ "adminPassword": "[parameters('adminPassword')]"
21
+ <% else %>
22
+ "linuxConfiguration": {
23
+ "disablePasswordAuthentication": "true",
24
+ "ssh": {
25
+ "publicKeys": [
26
+ {
27
+ "path": "[variables('sshKeyPath')]",
28
+ "keyData": "[parameters('sshKeyData')]"
29
+ }
30
+ ]
31
+ }
32
+ }
33
+ <% end %>
34
+ },
35
+ "storageProfile": {
36
+ <% if vhd_uri.nil? && vm_managed_image_id.nil? %>
37
+ "imageReference": {
38
+ "publisher": "<%= image_publisher %>",
39
+ "offer": "<%= image_offer %>",
40
+ "sku": "<%= image_sku %>",
41
+ "version": "<%= image_version %>"
42
+ },
43
+ <% elsif vm_managed_image_id %>
44
+ "imageReference": {
45
+ "id": "<%= vm_managed_image_id %>"
46
+ },
47
+ <% else %>
48
+ "imageReference": {
49
+ "id": "[resourceId('Microsoft.Compute/images', variables('managedImageName'))]"
50
+ },
51
+ <% end %>
52
+ "osDisk": {
53
+ <% if vhd_uri || vm_managed_image_id %>
54
+ "osType": "<%= operating_system %>",
55
+ "managedDisk": {
56
+ "storageAccountType": "<%= storage_account_type %>"
57
+ },
58
+ <% end %>
59
+ "createOption": "fromImage",
60
+ "caching": "ReadWrite"
61
+ },
62
+ "dataDisks" : [
63
+ <%= data_disks.each_with_index.map { |disk, idx|
64
+ VagrantPlugins::Azure::Util::TemplateRenderer.render("arm/resources/data_disk.json", {lun: idx + 2}.merge(disk))
65
+ }.join(", ")
66
+ %>
67
+ ]
68
+ },
69
+ "networkProfile": {
70
+ "networkInterfaces": [
71
+ {
72
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
73
+ }
74
+ ]
75
+ }
76
+ <% if availability_set_name %>,
77
+ "availabilitySet": {
78
+ "id": "[resourceId('Microsoft.Compute/availabilitySets', '<%= availability_set_name %>')]"
79
+ }
80
+ <% end %>
81
+ }
82
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "apiVersion": "2016-03-30",
3
+ "type": "Microsoft.Network/virtualNetworks",
4
+ "name": "[parameters('virtualNetworkName')]",
5
+ "location": "[variables('location')]",
6
+ "dependsOn": [
7
+ "[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]"
8
+ ],
9
+ "properties": {
10
+ "addressSpace": {
11
+ "addressPrefixes": [
12
+ "[variables('addressPrefix')]"
13
+ ]
14
+ },
15
+ "subnets": [
16
+ {
17
+ "name": "[parameters('subnetName')]",
18
+ "properties": {
19
+ "addressPrefix": "[variables('subnetPrefix')]",
20
+ "networkSecurityGroup": {
21
+ "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
22
+ }
23
+ }
24
+ }
25
+ ]
26
+ }
27
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "type": "Microsoft.Compute/virtualMachines/extensions",
3
+ "name": "<%= name %>",
4
+ "apiVersion": "2015-06-15",
5
+ "location": "[resourceGroup().location]",
6
+ "dependsOn": [
7
+ <%= (depends_on || []).map{ |resource| "\"#{resource}\"" }.join(", ") %>
8
+ ],
9
+ "properties": {
10
+ "publisher": "Microsoft.Compute",
11
+ "type": "VMAccessAgent",
12
+ "typeHandlerVersion": "2.0",
13
+ "autoUpgradeMinorVersion": true,
14
+ "settings": {
15
+ "UserName": "<%= username %>"
16
+ },
17
+ "protectedSettings": {
18
+ "Password": "<%= password %>"
19
+ }
20
+ }
21
+ }
@@ -19,15 +19,13 @@ Gem::Specification.new do |s|
19
19
  s.bindir = 'bin'
20
20
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
21
 
22
- s.add_runtime_dependency 'azure_mgmt_resources', '~>0.8.0'
23
- s.add_runtime_dependency 'azure_mgmt_compute', '~>0.8.0'
24
- s.add_runtime_dependency 'azure_mgmt_network', '~>0.8.0'
25
- s.add_runtime_dependency 'azure_mgmt_storage', '~>0.8.0'
26
- s.add_runtime_dependency 'faraday', '~>0.11.0'
22
+ s.add_runtime_dependency 'azure_mgmt_resources', '~>0.10.0'
23
+ s.add_runtime_dependency 'azure_mgmt_compute', '~>0.10.0'
24
+ s.add_runtime_dependency 'azure_mgmt_network', '~>0.10.0'
25
+ s.add_runtime_dependency 'azure_mgmt_storage', '~>0.10.0'
27
26
  s.add_runtime_dependency 'haikunator', '~>1.1'
28
27
  s.add_runtime_dependency 'highline', '~>1.7'
29
28
 
30
- s.add_development_dependency 'bundler', '~>1.9'
31
29
  s.add_development_dependency 'rake', '~>11.1'
32
30
  s.add_development_dependency 'rspec', '~>3.4'
33
31
  s.add_development_dependency 'simplecov', '~>0.11'
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: 2.0.0.pre7
4
+ version: 2.0.0.pre8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Azure
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: azure_mgmt_resources
@@ -16,70 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.0
19
+ version: 0.10.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.0
26
+ version: 0.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: azure_mgmt_compute
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.0
33
+ version: 0.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.0
40
+ version: 0.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: azure_mgmt_network
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.0
47
+ version: 0.10.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.0
54
+ version: 0.10.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: azure_mgmt_storage
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.0
61
+ version: 0.10.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.0
69
- - !ruby/object:Gem::Dependency
70
- name: faraday
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.11.0
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.11.0
68
+ version: 0.10.0
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: haikunator
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +94,6 @@ dependencies:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
96
  version: '1.7'
111
- - !ruby/object:Gem::Dependency
112
- name: bundler
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.9'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.9'
125
97
  - !ruby/object:Gem::Dependency
126
98
  name: rake
127
99
  requirement: !ruby/object:Gem::Requirement
@@ -186,11 +158,24 @@ extra_rdoc_files: []
186
158
  files:
187
159
  - ".gitignore"
188
160
  - ".rspec"
161
+ - ".rubocop.yml"
162
+ - ".travis.yml"
189
163
  - CHANGELOG.md
190
164
  - Gemfile
191
165
  - LICENSE
192
166
  - README.md
193
167
  - Rakefile
168
+ - docs/basic_linux/Vagrantfile
169
+ - docs/basic_linux/readme.md
170
+ - docs/basic_windows/Vagrantfile
171
+ - docs/basic_windows/readme.md
172
+ - docs/custom_vhd/Vagrantfile
173
+ - docs/custom_vhd/readme.md
174
+ - docs/data_disks/Vagrantfile
175
+ - docs/data_disks/readme.md
176
+ - docs/managed_image/Vagrantfile
177
+ - docs/managed_image/readme.md
178
+ - docs/readme.md
194
179
  - dummy.box
195
180
  - example_box/README.md
196
181
  - example_box/Vagrantfile
@@ -219,15 +204,28 @@ files:
219
204
  - lib/vagrant-azure/provider.rb
220
205
  - lib/vagrant-azure/services/azure_resource_manager.rb
221
206
  - lib/vagrant-azure/util/machine_id_helper.rb
207
+ - lib/vagrant-azure/util/managed_image_helper.rb
208
+ - lib/vagrant-azure/util/template_renderer.rb
222
209
  - lib/vagrant-azure/util/timer.rb
223
210
  - lib/vagrant-azure/util/vm_await.rb
224
211
  - lib/vagrant-azure/util/vm_status_translator.rb
225
212
  - lib/vagrant-azure/version.rb
226
213
  - locales/en.yml
227
214
  - spec/spec_helper.rb
215
+ - spec/templates/arm/deployment_spec.rb
228
216
  - spec/vagrant-azure/config_spec.rb
229
- - spec/vagrant-azure/services/azure_resource_manager_spec.rb
230
217
  - templates/arm/deployment.json.erb
218
+ - templates/arm/resources/availability_set.json.erb
219
+ - templates/arm/resources/data_disk.json.erb
220
+ - templates/arm/resources/import_vhd_image.json.erb
221
+ - templates/arm/resources/linux_reset_root_ext.json.erb
222
+ - templates/arm/resources/network_interface.json.erb
223
+ - templates/arm/resources/network_security_group.json.erb
224
+ - templates/arm/resources/public_ip_address.json.erb
225
+ - templates/arm/resources/storage_account.json.erb
226
+ - templates/arm/resources/virtual_machine.json.erb
227
+ - templates/arm/resources/virtual_network.json.erb
228
+ - templates/arm/resources/windows_reset_access_ext.json.erb
231
229
  - templates/arm/selfsignedcert.json.erb
232
230
  - templates/arm/setup-winrm.ps1.erb
233
231
  - templates/provisioners/chef-solo/solo.erb
@@ -252,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
250
  version: 1.3.1
253
251
  requirements: []
254
252
  rubyforge_project:
255
- rubygems_version: 2.6.9
253
+ rubygems_version: 2.4.8
256
254
  signing_key:
257
255
  specification_version: 4
258
256
  summary: Enable Vagrant to manage Windows and Linux machines in Microsoft Azure.
@@ -1,19 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright (c) Microsoft Corporation. All rights reserved.
3
- # Licensed under the MIT License. See License in the project root for license information.
4
-
5
- require 'vagrant-azure/services/azure_resource_manager'
6
-
7
- module VagrantPlugins
8
- module Azure
9
- module Services
10
- describe AzureResourceManager do
11
-
12
- it 'should be hello world' do
13
-
14
- end
15
-
16
- end
17
- end
18
- end
19
- end