ansible/ansible — pull request #9537 by cchurch (2014-11-11 07:36:21+00:00)
Title: Updates to ConfigureRemotingForAnsible.ps1

Updated firewall rules to include changes from https://github.com/ansible/ansible/pull/9372 and https://github.com/ansible/ansible/pull/9474. If run on a host already configured with an earlier version of the script, it will update the existing firewall rule. If run multiple times on the same host, it will not create additional firewall rules.

Updated error handling so the script will stop and return a nonzero exit code on failure.

Updated comments/messages/capitalization/whitespace for consistency/readability (maybe https://github.com/ansible/ansible/blob/devel/CODING_GUIDELINES.md needs a PowerShell section?).

Tested against Server 2008, 2008 R2, 2012 and 2012 R2 on EC2 by adding the following user data:

Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/cchurch/ansible/2f7348fddf3add69eb620d5e1ca6cdf1ec55a534/examples/scripts/ConfigureRemotingForAnsible.ps1'))