Skip to content

Instantly share code, notes, and snippets.

@danieltmckean
Created June 25, 2012 03:46
Show Gist options
  • Save danieltmckean/2986396 to your computer and use it in GitHub Desktop.
Save danieltmckean/2986396 to your computer and use it in GitHub Desktop.
Userdata bootstrap script for Windows EC2 instances
<script>
echo Dim oXMLHTTP, oStream > GetPE.vbs
echo Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0") >> GetPE.vbs
echo oXMLHTTP.Open "GET", "http://puppetmaster.local/boot/pe.msi", False >> GetPE.vbs
echo oXMLHTTP.Send >> GetPE.vbs
echo If oXMLHTTP.Status = 200 Then >> GetPE.vbs
echo Set oStream = CreateObject("ADODB.Stream") >> GetPE.vbs
echo oStream.Open >> GetPE.vbs
echo oStream.Type = 1 >> GetPE.vbs
echo oStream.Write oXMLHTTP.responseBody >> GetPE.vbs
echo oStream.SaveToFile "c:\Users\Administrator\Desktop\pe.msi",2 >> GetPE.vbs
echo oStream.Close >> GetPE.vbs
echo End If >> GetPE.vbs
echo CreateObject("WScript.Shell").Run "msiexec /qn /i c:\Users\Administrator\Desktop\pe.msi PUPPET_MASTER_SERVER=puppetmaster.local" >> GetPE.vbs
cscript GetPE.vbs
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment