This repository has been archived by the owner on Jan 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathvirtual_machine.json.erb
82 lines (82 loc) · 2.4 KB
/
virtual_machine.json.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"apiVersion": "2016-04-30-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('vmName')]",
"location": "[variables('location')]",
"dependsOn": [
<%= (depends_on || []).map{ |resource| "\"#{resource}\"" }.join(", ") %>
],
<% if operating_system == 'Windows' %>
<%= self_signed_cert_resource %>
<% end %>
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[parameters('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
<% if operating_system == 'Windows' %>
"adminPassword": "[parameters('adminPassword')]"
<% else %>
"linuxConfiguration": {
"disablePasswordAuthentication": "true",
"ssh": {
"publicKeys": [
{
"path": "[variables('sshKeyPath')]",
"keyData": "[parameters('sshKeyData')]"
}
]
}
}
<% end %>
},
"storageProfile": {
<% if vhd_uri.nil? && vm_managed_image_id.nil? %>
"imageReference": {
"publisher": "<%= image_publisher %>",
"offer": "<%= image_offer %>",
"sku": "<%= image_sku %>",
"version": "<%= image_version %>"
},
<% elsif vm_managed_image_id %>
"imageReference": {
"id": "<%= vm_managed_image_id %>"
},
<% else %>
"imageReference": {
"id": "[resourceId('Microsoft.Compute/images', variables('managedImageName'))]"
},
<% end %>
"osDisk": {
<% if vhd_uri || vm_managed_image_id %>
"osType": "<%= operating_system %>",
"managedDisk": {
"storageAccountType": "<%= storage_account_type %>"
},
<% end %>
"createOption": "fromImage",
"caching": "ReadWrite"
},
"dataDisks" : [
<%= data_disks.each_with_index.map { |disk, idx|
VagrantPlugins::Azure::Util::TemplateRenderer.render("arm/resources/data_disk.json", {lun: idx + 2}.merge(disk))
}.join(", ")
%>
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
}
]
}
<% if availability_set_name %>,
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', '<%= availability_set_name %>')]"
}
<% end %>
}
}