{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "pmAdminUsername": { "type": "string", "minLength": 1, "metadata": { "description": "User name for the Puppet Master Virtual Machine." }, "defaultValue": "puppetadmin" }, "pmAdminPassword": { "type": "securestring", "metadata": { "description": "Password for the Puppet Master Virtual Machine." } }, "pmDnsNameForPublicIP": { "type": "string", "minLength": 1, "metadata": { "description": "Globally unique DNS Name for the Public IP used to access the Puppet Master Virtual Machine." } }, "pmConsolePassword": { "type": "securestring", "metadata": { "description": "Password for the Puppet Master console admin account." } } }, "variables": { "pmImagePublisher": "Canonical", "pmImageOffer": "UbuntuServer", "pmImageSku": "16.04.3-LTS", "pmVersion": "2017.2.1", "pmOSDiskName": "puppetOsdisk", "pmNicName": "puppetNic", "addressPrefix": "10.0.0.0/16", "subnetName": "Subnet", "subnetPrefix": "10.0.0.0/24", "storageName": "[concat('vhdstorage', uniqueString(resourceGroup().id))]", "storageType": "Standard_LRS", "publicIPAddressType": "Dynamic", "vhdStorageContainerName": "vhds", "pmNsgName": "pmNSG", "pmVmSize": "Standard_A3", "pmVmName": "[toLower(parameters('pmDnsNameForPublicIP'))]", "virtualNetworkName": "puppetVNET", "vnetId": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", "subnetRef": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]" }, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "name": "[toLower(variables('storageName'))]", "apiVersion": "2015-05-01-preview", "location": "[resourceGroup().location]", "tags": { "displayName": "StorageAccount" }, "properties": { "accountType": "[variables('storageType')]" } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkSecurityGroups", "name": "[variables('pmNsgName')]", "location": "[resourceGroup().location]", "tags": { "displayName": "NSG-Puppet" }, "properties": { "securityRules": [ { "name": "SSH", "properties": { "description": "SSH port", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "22", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1000, "direction": "Inbound" } }, { "name": "HTTPS", "properties": { "description": "HTTPS port", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "443", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1100, "direction": "Inbound" } }, { "name": "Puppet", "properties": { "description": "Puppet port", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "8140", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1200, "direction": "Inbound" } }, { "name": "MCollective", "properties": { "description": "MCollective port", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "61613", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 1300, "direction": "Inbound" } } ] } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/publicIPAddresses", "name": "[parameters('pmDnsNameForPublicIP')]", "location": "[resourceGroup().location]", "tags": { "displayName": "PublicIPAddress-Puppet" }, "properties": { "publicIPAllocationMethod": "[variables('publicIPAddressType')]", "dnsSettings": { "domainNameLabel": "[parameters('pmDnsNameForPublicIP')]" } } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/virtualNetworks", "name": "[variables('virtualNetworkName')]", "location": "[resourceGroup().location]", "tags": { "displayName": "VirtualNetwork" }, "properties": { "addressSpace": { "addressPrefixes": [ "[variables('addressPrefix')]" ] }, "subnets": [ { "name": "[variables('subnetName')]", "properties": { "addressPrefix": "[variables('subnetPrefix')]" } } ] } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkInterfaces", "name": "[variables('pmNicName')]", "location": "[resourceGroup().location]", "tags": { "displayName": "NIC-Puppet" }, "dependsOn": [ "[concat('Microsoft.Network/publicIPAddresses/', parameters('pmDnsNameForPublicIP'))]", "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]", "[concat('Microsoft.Network/networkSecurityGroups/', variables('pmNSGName'))]" ], "properties": { "networkSecurityGroup": { "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('pmNSGName'))]" }, "ipConfigurations": [ { "name": "ipconfig1", "properties": { "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('pmDnsNameForPublicIP'))]" }, "subnet": { "id": "[variables('subnetRef')]" } } } ] } }, { "apiVersion": "2015-06-15", "type": "Microsoft.Compute/virtualMachines", "name": "[variables('pmVmName')]", "location": "[resourceGroup().location]", "tags": { "displayName": "VM-Puppet" }, "dependsOn": [ "[concat('Microsoft.Storage/storageAccounts/', variables('storageName'))]", "[concat('Microsoft.Network/networkInterfaces/', variables('pmNicName'))]" ], "properties": { "hardwareProfile": { "vmSize": "[variables('pmVmSize')]" }, "osProfile": { "computerName": "[variables('pmVmName')]", "adminUsername": "[parameters('pmAdminUsername')]", "adminPassword": "[parameters('pmAdminPassword')]" }, "storageProfile": { "imageReference": { "publisher": "[variables('pmImagePublisher')]", "offer": "[variables('pmImageOffer')]", "sku": "[variables('pmImageSku')]", "version": "latest" }, "osDisk": { "name": "osdisk", "vhd": { "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vhdStorageContainerName'),'/',variables('pmOSDiskName'),'.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" } }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('pmNicName'))]" } ] }, "diagnosticsProfile": { "bootDiagnostics": { "enabled": "true", "storageUri": "[reference(concat('Microsoft.Storage/storageAccounts/', variables('storageName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob]" } } } }, { "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('pmVmName'),'/CustomScriptForLinux')]", "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', variables('pmVmName'))]" ], "properties": { "publisher": "Microsoft.OSTCExtensions", "type": "CustomScriptForLinux", "typeHandlerVersion": "1.3", "autoUpgradeMinorVersion": "true", "settings": { "fileUris": [ "https://raw.githubusercontent.com/Microsoft/PartsUnlimitedMRP/master/deploy/azurestack/customscripts/puppet/install_puppet_1604.sh" ] }, "protectedSettings": { "commandToExecute": "[concat('bash install_puppet_1604.sh ', variables('pmVersion'), ' ', parameters('pmConsolePassword'))]" } } }, { "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('pmVmName'),'/LinuxVMAccessExtension')]", "apiVersion": "2015-06-15", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', variables('pmVmName'),'/extensions/CustomScriptForLinux')]" ], "properties": { "publisher": "Microsoft.OSTCExtensions", "type": "VMAccessForLinux", "typeHandlerVersion": "1.4", "autoUpgradeMinorVersion": "true", "settings": {}, "protectedSettings": { "username": "[parameters('pmAdminUsername')]", "password": "[parameters('pmAdminPassword')]" } } } ] }