This script will currently only work with Windows8, Windows 2012R2, Amazon Linux, RHEL6 and RHEL7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ($OctopusEnvironmentName -eq "Production") { | |
| # in production, we need to | |
| #Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default. | |
| $URL = "http://api.newrelic.com/deployments.xml" | |
| $post = "deployment[account_id]=<id here>&deployment[user]=OctopusDeploy&deployment[app_id]=<app id here>&deployment[revision]=($OctopusPackageVersion)" | |
| $URI = New-Object System.Uri($URL,$true) | |
| #Create a request object using the URI | |
| $request = [System.Net.HttpWebRequest]::Create($URI) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ohai::Config::disabled_plugins= [ | |
| # | |
| # add to client.rb file -- c:\chef\client.rb | |
| # | |
| # ref: http://www.slideshare.net/opscode/chef-conf-windowsdougireton # slide 30 | |
| # ohai plugins that have poor perf or are irrelevant to windows | |
| # | |
| "c", "cloud", "ec2", "rackspace", "eucalyptus", "command", "dmi", "dmi_common", | |
| "erlang", "groovy", "ip_scopes", "java", "keys", "lua", "mono", "network_listeners", | |
| "passwd", "perl", "php", "python", "ssh_host_key", "uptime", "virtualization", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Hso = New-Object Net.HttpListener | |
| $Hso.Prefixes.Add("http://+:8000/") | |
| $Hso.Start() | |
| While ($Hso.IsListening) { | |
| $HC = $Hso.GetContext() | |
| $HRes = $HC.Response | |
| $HRes.Headers.Add("Content-Type","text/plain") | |
| $Buf = [Text.Encoding]::UTF8.GetBytes((GC (Join-Path $Pwd ($HC.Request).RawUrl))) | |
| $HRes.ContentLength64 = $Buf.Length | |
| $HRes.OutputStream.Write($Buf,0,$Buf.Length) |
Long story short, ansible does not work on a Windows control machine, so you basically have to:
- either run
ansible --connection=local ...in the target vm - set up a separate control vm where ansible is installed via shell provisioner
Below are Vagrantfile examples for both approaches