Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ercenk/acba917caabb60f35600 to your computer and use it in GitHub Desktop.
Save Ercenk/acba917caabb60f35600 to your computer and use it in GitHub Desktop.
Custom script extension with N-1 nodes for the cluster
{
"name": "[concat('cluster-node', copyindex())]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [
"storageAccountsLoop"
],
"copy": {
"name": "clusterNodesLoop",
"count": "[variables('clusterSpec').clusterSizeMinusOne]"
},
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('clusterSpec').vmTemplate]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"commonSettings": {
"value": "[variables('commonSettings')]"
},
"networkSettings": {
"value": "[variables('networkSettings')]"
},
"machineSettings": {
"value": "[variables('machineSettings')]"
},
"storageAccountName": {
"value": "[concat(parameters('storageAccountNamePrefix'), variables(concat('storageAccountSuffixForNode', parameters('tshirtSize'), copyindex())))]"
},
"nodeId": {
"value": "[copyindex()]"
},
"vmSize": {
"value": "[variables('clusterSpec').vmSize]"
},
"vmScripts": {
"value": "[variables('vmScripts')]"
},
"commandToExecute": {
"value": "[variables('vmScripts').installCommand]"
}
}
}
}, {
"name": "last-cluster-node",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"dependsOn": [
"clusterNodesLoop"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('clusterSpec').vmTemplate]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"commonSettings": {
"value": "[variables('commonSettings')]"
},
"networkSettings": {
"value": "[variables('networkSettings')]"
},
"machineSettings": {
"value": "[variables('machineSettings')]"
},
"storageAccountName": {
"value": "[concat(parameters('storageAccountNamePrefix'), variables(concat('storageAccountSuffixForNode', parameters('tshirtSize'), variables('clusterSpec').lastNodeId)))]"
},
"nodeId": {
"value": "[variables('clusterSpec').lastNodeId]"
},
"vmSize": {
"value": "[variables('clusterSpec').vmSize]"
},
"vmScripts": {
"value": "[variables('vmScripts')]"
},
"commandToExecute": {
"value": "[variables('vmScripts').setupCommand]"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment