open-nomad/e2e/terraform/packer/windows-2016-amd64
Seth Hoenig 198e0d9f24 e2e: get consul ent in e2e packer builds
Using Consul Enterprise is going to be necessary for testing Nomad's
Consul Namespace integration in Nomad v1.1 in e2e.
2021-04-14 12:05:55 -06:00
..
disable-windows-updates.ps1
fix-tls.ps1
install-consul.ps1 e2e: get consul ent in e2e packer builds 2021-04-14 12:05:55 -06:00
install-docker.ps1 e2e: Windows provisioning improvements (#9246) 2020-11-09 13:29:40 -05:00
install-nuget.ps1 e2e: Windows provisioning improvements (#9246) 2020-11-09 13:29:40 -05:00
provision.ps1 E2E: remove broken Move-Item call during Windows provisioning 2021-04-09 09:49:42 -04:00
README.md
userdata.ps1 e2e: Windows provisioning improvements (#9246) 2020-11-09 13:29:40 -05:00

Windows Packer Build

There are a few boilerplate items in the Powershell scripts, explained below.

The default TLS protocol in the version of .NET that our Powershell cmdlets are built in it 1.0, which means plenty of properly configured HTTP servers will reject requests. The boilerplate snippet below sets this for the current script:

# Force TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

We need to run some of the scripts as an administrator role. The following is a safety check that we're doing so:

$RunningAsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (!$RunningAsAdmin) {
  Write-Error "Must be executed in Administrator level shell."
  exit 1
}