Я пытаюсь настроить WinRM во время создания виртуальной машины Windows с помощью Terraform.
Мои os_profile и os_profile_windows_config:
os_profile {
computer_name = "server-name"
admin_username = "${var.vm_username}"
admin_password = "${var.vm_password}"
custom_data = <<EOF
<powershell>
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow
net stop winrm
sc.exe config winrm start=auto
net start winrm
</powershell>
EOF
}
os_profile_windows_config {
provision_vm_agent = true
winrm {
protocol="http"
}
}
Когда я подключаюсь к виртуальной машине, я вижу CustomData.bin
файл в C:\AzureData
, но он не выполнил ни одной из Powershell. Прав ли я, думая, что это должно было быть выполнено, или мне нужно сделать еще один шаг, чтобы выполнить это?