-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.vmss.commands.json
144 lines (144 loc) · 4.23 KB
/
template.vmss.commands.json
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"metadata": {
"description": "location of resources"
}
},
"vmSku": {
"defaultValue": "Standard_D1_v2",
"type": "string",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
}
},
"image": {
"type": "string",
"metadata": {
"description": "The os disk image for the VMs in the scale set."
}
},
"vmssName": {
"maxLength": 61,
"type": "string",
"metadata": {
"description": "String used as a base for naming resources. Must be 3-61 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
}
},
"instanceCount": {
"type": "int",
"metadata": {
"description": "Number of VM instances (100 or less)."
}
},
"username": {
"type": "string",
"metadata": {
"description": "Admin username on all VMs."
}
},
"sshPublicKey": {
"defaultValue": "",
"type": "string",
"metadata": {
"description": "ssh public key for connecting to VMs."
}
},
"dataDiskSizeGB" : {
"type" : "int",
"defaultValue": 100,
"minValue": 1,
"metadata": {
"description" : "One data disk will be added automatically with this size."
}
},
"networkConfiguration": {
"type": "object"
},
"commandsJson": {
"type": "secureObject",
"defaultValue": {
"Commands": []
}
},
"contentRoot": {
"type": "string"
}
},
"variables": {
"resourceLocation": "[parameters('location')]",
"curl": "curl -S -s --connect-timeout 5 --retry 15",
"autoPartUrl": "[concat(parameters('contentRoot'), '/initScripts/autopart.sh')]",
"localAutoPart": "/root/autopart.sh",
"scriptName": "runScripts.sh",
"machineSetupScriptUri": "[concat(parameters('contentRoot'), '/', variables('scriptName'))]",
"autoPartCommands": [
{
"name": "Download autopart.sh",
"command": "[concat(variables('curl'), ' -o ', variables('localAutoPart'), ' ', variables('autoPartUrl'))]"
},
{
"name": "chmod autopart.sh",
"command": "[concat('chmod 0755 ', variables('localAutoPart'))]"
},
{
"name": "execute autopart.sh",
"command": "[variables('localAutoPart')]"
}
],
"commands": "[concat(variables('autoPartCommands'), parameters('commandsJson').Commands)]",
"scriptCommand": "[concat('sh ', variables('scriptName'), ' ', parameters('contentRoot'), ' ', base64(string(variables('commands'))))]"
},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"name": "[concat('ConsoritumNode.', parameters('vmssName'), '.VMSS')]",
"apiVersion": "2015-01-01",
"properties": {
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[concat(parameters('contentRoot'), '/template.vmss.json')]"
},
"mode": "Incremental",
"parameters": {
"location": {
"value": "[variables('resourceLocation')]"
},
"vmssName": {
"value": "[parameters('vmssName')]"
},
"vmSku": {
"value": "[parameters('vmSku')]"
},
"image": {
"value": "[parameters('image')]"
},
"instanceCount": {
"value": "[parameters('instanceCount')]"
},
"username": {
"value": "[parameters('username')]"
},
"sshPublicKey": {
"value": "[parameters('sshPublicKey')]"
},
"scriptUri": {
"value": "[variables('machineSetupScriptUri')]"
},
"scriptCommand": {
"value": "[variables('scriptCommand')]"
},
"networkConfiguration": {
"value": "[parameters('networkConfiguration')]"
},
"dataDiskSizeGB" : {
"value": "[parameters('dataDiskSizeGB')]"
}
}
}
}
]
}