This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set Environment Variables for Azure RM Terraform | |
$ENV:ARM_SUBSCRIPTION_ID = "" | |
$ENV:ARM_CLIENT_ID = "" | |
$ENV:ARM_CLIENT_SECRET = "" # This should end with an '=' symbol | |
$ENV:ARM_TENANT_ID = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory = $true)] $imagePathArray, | |
[Parameter(Mandatory = $true)] $emailFrom, | |
[Parameter(Mandatory = $true)] $emailSubject, | |
[Parameter(Mandatory = $true)] $smtpServer, | |
[Parameter(Mandatory = $true)] $SendTo, | |
$emailBodyTitle=$emailSubject | |
) | |
if (!($imagePathArray.Gettype().BaseType.Name -eq "Array")) { | |
Write-Host "ImagePathArray must be of type Array" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-PoolDetails { | |
Param( | |
[Parameter(Mandatory=$true)]$StorageProc | |
) | |
$PoolInfo = naviseccli -h $StorageProc storagepool -list | |
$poolLine1TAG = "Pool Name" | |
$poolLine2TAG = "Pool ID" | |
$poolLine3TAG = "LUNs" | |
$poolLine4TAG = "User Capacity \(GBs\)" | |
$poolLine5TAG = "Available Capacity \(GBs\)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a virtual network in the web_servers resource group | |
resource "azurerm_virtual_network" "pipelineNetwork" { | |
name = "pipelineNetwork" | |
address_space = ["10.0.0.0/16"] | |
location = "North Europe" | |
resource_group_name = "${azurerm_resource_group.pipelineResources.name}" | |
} | |
resource "azurerm_subnet" "pipelineSubnet1" { | |
name = "pipelineSubnet1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y jq nodejs npm | |
sudo npm install -g azure-cli | |
sudo ln -s /usr/bin/nodejs /usr/bin/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"azure_client_id": "{{env `PACKER_ARM_CLIENT_ID`}}", | |
"azure_client_secret": "{{env `PACKER_ARM_CLIENT_SECRET`}}", | |
"azure_subscription_id": "{{env `PACKER_ARM_SUBSCRIPTION_ID`}}", | |
"azure_object_id": "{{env `PACKER_ARM_OBJECT_ID`}}" | |
}, | |
"builders": [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will not create the storage account for use with packer, just the auth | |
Param ( | |
$ApplicationName="Packer", | |
$AppURL="http://packer.io", | |
[Parameter(Mandatory=$true)]$AppPassword, | |
$AppRoleAssigned="Owner" | |
) | |
$Account = Login-AzureRmAccount | |
$Subs = Get-AzureRmSubscription |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start-Transcript -Path C:\Deploy.Log | |
Write-Host "Setup WinRM for $RemoteHostName" | |
$Cert = New-SelfSignedCertificate -DnsName $RemoteHostName, $ComputerName ` | |
-CertStoreLocation "cert:\LocalMachine\My" ` | |
-FriendlyName "Test WinRM Cert" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VIP address | |
resource "azurerm_public_ip" "load_balancer_public_ip" { | |
name = "${var.vm_name_prefix}-ip" | |
location = "${var.azure_region_fullname}" | |
resource_group_name = "${azurerm_resource_group.resource_group.name}" | |
public_ip_address_allocation = "dynamic" | |
domain_name_label = "${azurerm_resource_group.resource_group.name}" | |
} | |
# Front End Load Balancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_lb_nat_rule" "winrm_nat" { | |
location = "${var.azure_region_fullname}" | |
resource_group_name = "${azurerm_resource_group.resource_group.name}" | |
loadbalancer_id = "${azurerm_lb.load_balancer.id}" | |
name = "WinRM-HTTPS-vm-${count.index}" | |
protocol = "Tcp" | |
frontend_port = "${count.index + 10000}" | |
backend_port = "${var.vm_winrm_port}" | |
frontend_ip_configuration_name = "${var.vm_name_prefix}-ipconfig" | |
count = "${var.vm_count}" |
OlderNewer