I am using terraform provisioner file & remote-exec to install google chrome after the VM is created. But it is giving error while running terraform apply. I have also enabled nsg rule to allow all port. I am not sure if the error is related to nsg rule or not.
Error: timeout - last error: unknown error Post "https://10.0.2.4:5986/wsman": dial tcp 10.0.2.4:5986: connectex: A connection attempt failed because the connected party did not properly respond after a
period of time, or established connection failed because connected host has failed to respond.
resource "azurerm_virtual_machine" "myterraformvm" {
name = "Test-01"
location = "East Us"
resource_group_name = data.azurerm_resource_group.test.name
network_interface_ids = ["${azurerm_network_interface.main.id}"]
vm_size = "Standard_DS1_v2"
storage_os_disk {
name = "${azurerm_managed_disk.copy.name}"
os_type = "Windows"
managed_disk_id = "${azurerm_managed_disk.copy.id}"
create_option = "Attach"
}
provisioner "file" {
source = "./google_chrome_install.ps1"
destination = "C:/"
connection {
host = "${azurerm_network_interface.main.private_ip_address}"
type = "winrm"
https = true
port = 5986
use_ntlm = true
insecure = true
user = "testadmin"
password = "*******"
}
}
provisioner "remote-exec" {
connection {
host = "${azurerm_network_interface.main.private_ip_address}"
type = "winrm"
https = true
port = 5986
use_ntlm = true
insecure = true
user = "testadmin"
password = "***"
}
inline = [
"powershell -ExecutionPolicy Unrestricted -File C:/google_chrome_install.ps1 -Schedule"
]
}
}
10.0.2.4
on5986
? How are you routing to that private IP address? – ydaetskcoR