Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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