

You received this message because you are subscribed to a topic in the Google Groups "Terraform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/terraform-tool/wCvlMkE-Nww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/FA6CEEB3-8B3B-47E6-A372-FCB53B32E445%40xanzy.io.
Hi,
Not sure on how Azure does this but with AWS I need to set the admin password as part of the user data script if I want to use a provisioner. Your script does everything else though, in my setup I just open port 5985 in the Windows firewall and security group. I am trying though to remove WinRM from my systems and provision everything through user data.
Andrew.
From: terrafo...@googlegroups.com [mailto:terrafo...@googlegroups.com]
On Behalf Of Aman Sharma
Sent: 02 May 2016 18:19
To: Terraform <terrafo...@googlegroups.com>
Subject: Re: [terraform] Azure - Endpoints for Windows machines does not open ports on Windows Firewall
Sorry to open this year old post, but I had a similar issue. I'm trying to provision AWS Windows instances, but Terraform times out when trying to connect to the instance. I'm guessing it's because winRM isn't configured by default on the Windows instance, like Sander mentioned here. A few weeks ago, I was trying to use Chef Provisioning to do the same thing and ran into this problem. I resolved that by passing this user data that configured winRM to Chef Provisioning:
"<powershell>\nwinrm quickconfig -q\nwinrm set winrm/config/winrs '@{MaxMemoryPerShellMB=\"300\"}'\nwinrm set winrm/config '@{MaxTimeoutms=\"1800000\"}'\nwinrm set winrm/config/service '@{AllowUnencrypted=\"true\"}'\nwinrm set winrm/config/service/auth
'@{Basic=\"true\"}'\n\nnetsh advfirewall firewall add rule name=\"WinRM 5985\" protocol=TCP dir=in localport=5985 action=allow\nnetsh advfirewall firewall add rule name=\"WinRM 5986\" protocol=TCP dir=in localport=5986 action=allow\n\nnet stop winrm\nsc config
winrm start=auto\nnet start winrm\ncscript C:\\Windows\\System32\\Scregedit.wsf /au 1\n</powershell>"
With this, I was able to provision Windows instances. However, if I pass this same user data in Terraform, it doesn't work and it times out again. I also specified a security group that permits RDP connections, but that didn't help. Does anyone have an idea
of how I should proceed from here?
On Friday, August 28, 2015 at 2:35:32 PM UTC-5, Sander van Harmelen wrote:
Maybe they do use a security group? Or add/tweak some other parts of the stack? Not sure without having a look at the internals...
Sander
On 28/08/2015, at 20:50 , Iain Black <iaing...@gmail.com> wrote:
Sorry for the delay. Many thanks for looking into this. I'll look to create some preprepared images that have the port enabled so we can use terraform. I'm a bit mystified as to how vagrant and the vagrant-azure plugin can do a chef-run on a freshly deployed azure image though. Surely it would have the same restrictions? Thanks so much for looking into this though!
CheersIain
On 21 Aug 2015, at 11:06, Sander van Harmelen <san...@xanzy.io> wrote:
Hi Iain,
So I took some time to look at this today and could reproduce your issue. But it turns out this is not related to Terraform or Azure, but with the image you are using. If you use a standard (not WinRM prepared) Windows image you will not get this to work. The problem is the Windows Firewalls fault rules…
There are 2 rules defined for incoming WinRM traffic:
Now you see that the difference in these rules is the profile they are assigned to. The rule used for this kind of public traffic is of course the one assigned to the Public profile. If you have a look at this rule you’ll see that it only allows traffic from it's local subnet:
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/67b715d8-bbe7-4a08-8e2a-9194105d45f6%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com<mailto:terraform-tool+unsubscribe@googlegroups.com>.
Hi,
I found the Chef provisioner on Windows quite buggy and haven’t used it. If you want to go that route you will need to open WinRM on the hosts, and ensure you have the administrator account password. I am not sure if Terraform supports the AWS way of doing this, whereby the admin password is available with the management key after several minutes; I tend to reset this through user_data and provide it to Terraform as part of the WinRM connection.
I am currently using the Chef server through user_data, my script writes client.rb and gets the pem files via S3, as I don’t want to open WinRM at all if I can help it.
Hope this gives you some pointers.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com<mailto:terraform-too...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/158845ea-ba49-4bbc-bf34-8a04c9b9a38d%40googlegroups.com<https://groups.google.com/d/msgid/terraform-tool/158845ea-ba49-4bbc-bf34-8a04c9b9a38d%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/38375aff-1982-4d8f-9bd5-b470c21687a5%40googlegroups.com.