Forcing DNS Server settings on DC for Terraform

Addresses https://github.com/clong/DetectionLab/issues/370
This commit is contained in:
Chris Long
2020-01-06 22:36:32 -08:00
committed by GitHub
parent 85563d7742
commit 4d13f53866

View File

@@ -205,7 +205,11 @@ resource "aws_instance" "dc" {
instance_type = "t2.medium"
provisioner "remote-exec" {
inline = ["choco install -force -y winpcap"]
inline = [
"choco install -force -y winpcap",
"powershell -c \"$ifindex = get-netipinterface | where-object InterfaceAlias -eq 'Ethernet' | where-object AddressFamily -eq 2 | select-object -ExpandProperty ifIndex; set-dnsclientserveraddress -InterfaceIndex $ifindex\"",
"ipconfig /all"
]
connection {
type = "winrm"