diff --git a/postgresql-on-ubuntu/database-16disk-resources.json b/postgresql-on-ubuntu/database-16disk-resources.json index dd86ecf..d473292 100644 --- a/postgresql-on-ubuntu/database-16disk-resources.json +++ b/postgresql-on-ubuntu/database-16disk-resources.json @@ -22,6 +22,12 @@ }, "replicatorPassword": { "type": "securestring" + }, + "masterIpdAddress": { + "type": "string" + }, + "offset": { + "type": "int" } }, "variables": { @@ -38,7 +44,7 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('nicName'), copyindex())]", + "name": "[concat(variables('nicName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "copy": { "name": "nicCopyLoop", @@ -61,10 +67,10 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('vmName'), copyindex())]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]" + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex(parameters('offset')))]" ], "copy": { "name": "vmCopyLoop", @@ -78,7 +84,7 @@ "vmSize": "[parameters('machineSettings').vmSize]" }, "osProfile": { - "computername": "[concat(variables('vmName'), copyindex())]", + "computername": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "adminUsername": "[variables('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, @@ -87,7 +93,7 @@ "osDisk": { "name": "osdisk", "vhd": { - "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]" + "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(parameters('offset')), '-osdisk.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" @@ -98,7 +104,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 0, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk1.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk1.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -108,7 +114,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 1, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk2.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk2.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -118,7 +124,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 2, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk3.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk3.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -128,7 +134,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 3, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk4.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk4.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -138,7 +144,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 4, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk5.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk5.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -148,7 +154,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 5, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk6.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk6.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -158,7 +164,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 6, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk7.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk7.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -168,7 +174,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 7, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk8.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk8.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -178,7 +184,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 8, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk9.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk9.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -188,7 +194,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 9, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk10.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk10.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -198,7 +204,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 10, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk11.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk11.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -208,7 +214,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 11, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk12.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk12.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -218,7 +224,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 12, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk13.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk13.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -228,7 +234,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 13, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk14.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk14.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -238,7 +244,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 14, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk15.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk15.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -248,7 +254,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 15, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk16.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk16.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -258,7 +264,7 @@ "networkProfile": { "networkInterfaces": [ { - "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex()) )]" + "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex(parameters('offset'))) )]" } ] } @@ -266,11 +272,11 @@ }, { "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('vmName'), copyindex(), '/install_postgresql')]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')), '/install_postgresql')]", "apiVersion": "2015-05-01-preview", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex())]" + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex(parameters('offset')))]" ], "copy": { "name": "scriptCopyLoop", @@ -282,10 +288,15 @@ "typeHandlerVersion": "1.2", "settings": { "fileUris": "[parameters('osSettings').scripts]", - "commandToExecute": "[concat('bash install_postgresql.sh -m ', reference(concat(variables('nicName'), 0)).ipConfigurations[0].properties.privateIPAddress, ' -s ', parameters('subnet').prefix, ' -t ', copyindex(), ' -p ', parameters('replicatorPassword') )]" + "commandToExecute": "[concat('bash install_postgresql.sh -m ', parameters('masterIpdAddress'), ' -s ', parameters('subnet').prefix, ' -t ', copyindex(parameters('offset')), ' -p ', parameters('replicatorPassword') )]" } } } ], - "outputs": {} + "outputs": { + "masterip": { + "value": "[reference(concat(variables('nicName'),0)).ipConfigurations[0].properties.privateIPAddress]", + "type": "string" + } + } } \ No newline at end of file diff --git a/postgresql-on-ubuntu/database-2disk-resources.json b/postgresql-on-ubuntu/database-2disk-resources.json index 93fa612..94efadc 100644 --- a/postgresql-on-ubuntu/database-2disk-resources.json +++ b/postgresql-on-ubuntu/database-2disk-resources.json @@ -22,6 +22,12 @@ }, "replicatorPassword": { "type": "securestring" + }, + "masterIpdAddress": { + "type": "string" + }, + "offset": { + "type": "int" } }, "variables": { @@ -38,7 +44,7 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('nicName'), copyindex())]", + "name": "[concat(variables('nicName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "copy": { "name": "nicCopyLoop", @@ -61,10 +67,10 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('vmName'), copyindex())]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]" + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex(parameters('offset')))]" ], "copy": { "name": "vmCopyLoop", @@ -78,7 +84,7 @@ "vmSize": "[parameters('machineSettings').vmSize]" }, "osProfile": { - "computername": "[concat(variables('vmName'), copyindex())]", + "computername": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "adminUsername": "[variables('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, @@ -87,7 +93,7 @@ "osDisk": { "name": "osdisk", "vhd": { - "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]" + "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(parameters('offset')), '-osdisk.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" @@ -98,7 +104,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 0, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk1.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk1.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -108,7 +114,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 1, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk2.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk2.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -118,7 +124,7 @@ "networkProfile": { "networkInterfaces": [ { - "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex()) )]" + "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex(parameters('offset'))) )]" } ] } @@ -126,11 +132,11 @@ }, { "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('vmName'), copyindex(), '/install_postgresql')]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')), '/install_postgresql')]", "apiVersion": "2015-05-01-preview", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex())]" + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex(parameters('offset')))]" ], "copy": { "name": "scriptCopyLoop", @@ -142,10 +148,15 @@ "typeHandlerVersion": "1.2", "settings": { "fileUris": "[parameters('osSettings').scripts]", - "commandToExecute": "[concat('bash install_postgresql.sh -m ', reference(concat(variables('nicName'), 0)).ipConfigurations[0].properties.privateIPAddress, ' -s ', parameters('subnet').prefix, ' -t ', copyindex(), ' -p ', parameters('replicatorPassword') )]" + "commandToExecute": "[concat('bash install_postgresql.sh -m ', parameters('masterIpdAddress'), ' -s ', parameters('subnet').prefix, ' -t ', copyindex(parameters('offset')), ' -p ', parameters('replicatorPassword') )]" } } } ], - "outputs": {} + "outputs": { + "masterip": { + "value": "[reference(concat(variables('nicName'),0)).ipConfigurations[0].properties.privateIPAddress]", + "type": "string" + } + } } \ No newline at end of file diff --git a/postgresql-on-ubuntu/database-8disk-resources.json b/postgresql-on-ubuntu/database-8disk-resources.json index 3884bda..c98370d 100644 --- a/postgresql-on-ubuntu/database-8disk-resources.json +++ b/postgresql-on-ubuntu/database-8disk-resources.json @@ -22,6 +22,12 @@ }, "replicatorPassword": { "type": "securestring" + }, + "masterIpdAddress": { + "type": "string" + }, + "offset": { + "type": "int" } }, "variables": { @@ -38,7 +44,7 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkInterfaces", - "name": "[concat(variables('nicName'), copyindex())]", + "name": "[concat(variables('nicName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "copy": { "name": "nicCopyLoop", @@ -61,10 +67,10 @@ { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Compute/virtualMachines", - "name": "[concat(variables('vmName'), copyindex())]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex())]" + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyindex(parameters('offset')))]" ], "copy": { "name": "vmCopyLoop", @@ -78,7 +84,7 @@ "vmSize": "[parameters('machineSettings').vmSize]" }, "osProfile": { - "computername": "[concat(variables('vmName'), copyindex())]", + "computername": "[concat(variables('vmName'), copyindex(parameters('offset')))]", "adminUsername": "[variables('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, @@ -87,7 +93,7 @@ "osDisk": { "name": "osdisk", "vhd": { - "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]" + "uri": "[concat('http://',parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(parameters('offset')), '-osdisk.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" @@ -98,7 +104,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 0, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk1.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk1.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -108,7 +114,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 1, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk2.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk2.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -118,7 +124,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 2, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk3.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk3.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -128,7 +134,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 3, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk4.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk4.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -138,7 +144,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 4, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk5.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk5.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -148,7 +154,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 5, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk6.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk6.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -158,7 +164,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 6, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk7.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk7.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -168,7 +174,7 @@ "diskSizeGB": "[parameters('machineSettings').diskSize]", "lun": 7, "vhd": { - "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex()],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(),'-datadisk8.vhd')]" + "Uri": "[concat('http://', parameters('storageSettings').name, parameters('storageSettings').map[copyindex(parameters('offset'))],'.blob.core.windows.net/vhds/',variables('vmName'), copyindex(parameters('offset')),'-datadisk8.vhd')]" }, "caching": "None", "createOption": "Empty" @@ -178,7 +184,7 @@ "networkProfile": { "networkInterfaces": [ { - "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex()) )]" + "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nicName'), copyindex(parameters('offset'))) )]" } ] } @@ -186,11 +192,11 @@ }, { "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(variables('vmName'), copyindex(), '/install_postgresql')]", + "name": "[concat(variables('vmName'), copyindex(parameters('offset')), '/install_postgresql')]", "apiVersion": "2015-05-01-preview", "location": "[variables('region')]", "dependsOn": [ - "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex())]" + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), copyindex(parameters('offset')))]" ], "copy": { "name": "scriptCopyLoop", @@ -202,10 +208,15 @@ "typeHandlerVersion": "1.2", "settings": { "fileUris": "[parameters('osSettings').scripts]", - "commandToExecute": "[concat('bash install_postgresql.sh -m ', reference(concat(variables('nicName'), 0)).ipConfigurations[0].properties.privateIPAddress, ' -s ', parameters('subnet').prefix, ' -t ', copyindex(), ' -p ', parameters('replicatorPassword') )]" + "commandToExecute": "[concat('bash install_postgresql.sh -m ', parameters('masterIpdAddress'), ' -s ', parameters('subnet').prefix, ' -t ', copyindex(parameters('offset')), ' -p ', parameters('replicatorPassword') )]" } } } ], - "outputs": {} + "outputs": { + "masterip": { + "value": "[reference(concat(variables('nicName'),0)).ipConfigurations[0].properties.privateIPAddress]", + "type": "string" + } + } } \ No newline at end of file