Skip to content

Instantly share code, notes, and snippets.

@rgbkrk
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgbkrk/9099167 to your computer and use it in GitHub Desktop.
Save rgbkrk/9099167 to your computer and use it in GitHub Desktop.
[WIP] Orchestrating Windows Boxes to do Windows Builds

WinRM (Windows Remote Management) lets us manage a Windows box remotely. The WinRM service is already installed and running on Windows Server 2008+.

However, no WinRM listener is configured (see Microsoft's article on WinRM configuration).

Enable WinRM on the box

On the box over Remote Desktop (sadly), open a cmd prompt/powershell and run

winrm quickconfig

Example run:

PS C:\Users\Administrator> winrm quickconfig
WinRM service is already running on this machine.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:

Enable the WinRM firewall exception.

Make these changes [y/n]? y

WinRM has been updated for remote management.

WinRM firewall exception enabled.

Enable HTTPS as the transport option

winrm quickconfig -transport:https

At least for now, the only way I'm seeing to boostrap this is to setup a machine with the winrm enabled and create an image out of that.

pywinrm

import winrm

s = winrm.Session("162.209.125.52", auth=("Administrator", "thisisnotthepassword"))
r = s.run_cmd("ipconfig", ['/all'])

SaltStack

salt-cloud doesn't have a bootstrap script for Windows (yet), and libcloud needs a way to run scripts in Windows (Powershell, please).

http://docs.saltstack.com/topics/installation/windows.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment