Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"
- }
- }
Add Comment
Please, Sign In to add comment