This file contains hidden or 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)]$Domain, | |
[Parameter(Mandatory=$true)]$User, | |
[Parameter(Mandatory=$true)]$computerName | |
) | |
$WindowsAccount = Get-WmiObject -Class Win32_Account -Filter "Domain='$($domain)' and Name='$($user)'" | |
if ($WindowsAccount) { | |
#### Add user/group into the local group |
This file contains hidden or 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
ip_configuration { | |
name = "${var.vm_name_prefix}-${count.index}-ipConfig" | |
subnet_id = "${azurerm_subnet.subnet1.id}" | |
private_ip_address_allocation = "dynamic" | |
load_balancer_backend_address_pools_ids = ["${azurerm_lb_backend_address_pool.backend_pool.id}"] | |
load_balancer_inbound_nat_rules_ids = ["${element(azurerm_lb_nat_rule.winrm_nat.*.id, count.index)}"] | |
} |
This file contains hidden or 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}" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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\)" |