-
Notifications
You must be signed in to change notification settings - Fork 6
/
jumpbox-linux.json
187 lines (187 loc) · 6.26 KB
/
jumpbox-linux.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json# ",
"contentVersion": "1.0.0.0",
"parameters": {
"newStorageAccountName": {
"type": "string",
"metadata": {
"description": "Unique DNS Name Prefix for the Storage Account where the Virtual Machine's disks will be placed. StorageAccounts may contain at most variables('vmsPerStorageAccount')"
}
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Username for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"dnsNameForJumpboxPublicIP": {
"type": "string",
"metadata": {
"description": "Sets the Domain name label for the jumpbox. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address."
}
},
"jumpboxVMSize": {
"type": "string",
"metadata": {
"description": "The VM role size of the jump box"
}
},
"subnetPrefix": {
"type": "string",
"metadata": {
"description": "The network subnet"
}
},
"subnetRef": {
"type": "string",
"metadata": {
"description": "The network subnet reference"
}
},
"jumpboxAddr": {
"type": "int",
"metadata": {
"description": "The value of the 4th IPv4 octet of the jumpbox within the subnet"
}
},
"jumpboxVMNamePrefix": {
"type": "string",
"metadata": {
"description": "The vm name prefix that identifies the jumpbox."
}
},
"customScriptLocation": {
"type": "string",
"metadata": {
"description": "The github location for the shell scripts."
}
},
"masterVMNamePrefix": {
"type": "string",
"metadata": {
"description": "The vm name prefix of the master"
}
},
"sshRSAPublicKey": {
"type": "string",
"metadata": {
"description": "Configure all linux machines with the SSH rsa public key string. Use 'disabled' to not configure access with SSH rsa public key."
}
}
},
"variables": {
"vmName": "[concat(parameters('jumpboxVMNamePrefix'), '1')]",
"osImagePublisher": "Canonical",
"osImageOffer": "UbuntuServer",
"osImageSKU": "14.04.3-LTS",
"osImageVersion": "latest",
"wgetCommandPrefix": "[concat('wget --tries 20 --retry-connrefused --waitretry=15 -qO- ', parameters('customScriptLocation'), 'configure-ubuntu.sh | nohup /bin/bash -s ')]",
"wgetCommandPostfix": " >> /var/log/azure/cluster-bootstrap.log 2>&1 &'",
"commandPrefix": "/bin/bash -c '"
},
"resources": [
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[parameters('dnsNameForJumpboxPublicIP')]",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "[parameters('dnsNameForJumpboxPublicIP')]"
}
}
},
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(variables('vmName'), '-nic')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('dnsNameForJumpboxPublicIP'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipConfig",
"properties": {
"privateIPAllocationMethod": "Static",
"privateIPAddress": "[concat(split(parameters('subnetPrefix'),'0/18')[0], parameters('jumpboxAddr'))]",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('dnsNameForJumpboxPublicIP'))]"
},
"subnet": {
"id": "[parameters('subnetRef')]"
}
}
}
]
}
},
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('vmName'), '-nic')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('jumpboxVMSize')]"
},
"osProfile": {
"computername": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('osImagePublisher')]",
"offer": "[variables('osImageOffer')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
"osDisk": {
"name": "[concat(variables('vmName'),'-osdisk')]",
"vhd": {
"uri": "[concat('http://', parameters('newStorageAccountName'), '.blob.core.windows.net/vhds/', variables('vmName'), '-osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('vmName'), '-nic'))]"
}
]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'), '/configurejumpbox')]",
"apiVersion": "2015-06-15",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.3",
"settings": {
"commandToExecute": "[concat(variables('commandPrefix'), variables('wgetCommandPrefix'), parameters('adminUsername'), ' \"', parameters('sshRSAPublicKey'), '\" ', variables('wgetCommandPostfix'))]"
}
}
}
]
}