{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "moodleCommon": { "metadata": { "description": "Common Moodle values" }, "type": "object" } }, "resources": [ { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[concat(parameters('moodleCommon').elasticVmName1,'/','install_elastic')]", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.Extensions", "settings": { "fileUris": [ "[variables('scriptUri')]" ] }, "protectedSettings":{ "commandToExecute": "[variables('cmdExec')]" }, "type": "CustomScript", "typeHandlerVersion": "2.0" }, "tags": { "displayName": "install_elastic" }, "type": "Microsoft.Compute/virtualMachines/extensions" }, { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[concat(parameters('moodleCommon').elasticVmName2,'/','install_elastic')]", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.Extensions", "settings": { "fileUris": [ "[variables('scriptUri')]" ] }, "protectedSettings":{ "commandToExecute": "[variables('cmdExec')]" }, "type": "CustomScript", "typeHandlerVersion": "2.0" }, "tags": { "displayName": "install_elastic" }, "type": "Microsoft.Compute/virtualMachines/extensions" }, { "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "name": "[concat(parameters('moodleCommon').elasticVmName3,'/','install_elastic')]", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.Extensions", "settings": { "fileUris": [ "[variables('scriptUri')]" ] }, "protectedSettings":{ "commandToExecute": "[variables('cmdExec')]" }, "type": "CustomScript", "typeHandlerVersion": "2.0" }, "tags": { "displayName": "install_elastic" }, "type": "Microsoft.Compute/virtualMachines/extensions" } ], "variables": { "cmdExec": "[concat('bash ', parameters('moodleCommon').elasticScriptFilename, ' ', parameters('moodleCommon').elasticClusterName, ' ', parameters('moodleCommon').elasticVm1IP, ' ', parameters('moodleCommon').elasticVm2IP, ' ', parameters('moodleCommon').elasticVm3IP)]", "documentation01": "This sub-template applies a specific post-deployment script to the controller vm", "documentation02": "It expects certain values in the 'common' datastructure.", "documentation03": " scriptLocation - web URI", "documentation04": " elasticScriptFilename - name of script file", "documentation05": " elasticVmName - name of the elastic search vm generic name", "scriptUri": "[concat(parameters('moodleCommon').scriptLocation,parameters('moodleCommon').elasticScriptFilename,parameters('moodleCommon').artifactsSasToken)]" } }