jenkinsci/ec2-plugin — pull request #67 by masterzen (2013-10-28 15:09:36+00:00)
Title: Windows slave support

This changeset introduces support for windows AMI to the ec2-plugin.
The windows slaves are connected to with SMB over TCP to send the initial
slave.jar and connected to from jenkins using WinRM/WinRS.

Unlile linux based AMI, the windows AMI requires:

* a specific security group allowing SMB over TCP (incoming TCP port 445)
* a specific securify group alloaing WinRM (incoming TCP port 5985)
* a java virtual machine installed in the Windows %PATH%
* SMB over TCP should be enabled in the windows firewall (this can be
done with: `netsh firewall set portopening tcp 445 smb enable`)
* WinRM must be configured and enabled, with the following commands:
* `winrm quickconfig` (answer y to both questions)
* `winrm set winrm/config/service/Auth @{Basic="true"}`
* `winrm set winrm/config/service @{AllowUnencrypted="true"}`
* `winrm set winrm/config/winrs @{MaxMemoryPerShellMB="1024"}`
* a fixed administrator password (there's no way for the plugin
to figure out the random password of the base EC2 Windows AMI)

This changeset enhance the Slave Template configuration to specify a
Windows only settings (like windows administrator password of the configured
remote user). Unix only settings have been grouped into their own Unix section.

Note: the current WinRM implementation is not running onto encrypted
transport, nor use encrypted payloads. This will come in a subsequent
patch on this pull request (or a new one).

Note2: the current WinRM implementation is very roughly based on Xebialabs'
Overthere and WinRB ruby implementation. All credits goes to them. If you're asking
why this patch doesn't use Overthere directly: for the short story latest overthere version
requires Guava 14 which is not backward compatible with the Guava required by Jenkins itself.
The other reason being that jenkins sends binary data to the slave process, which wasn't well
supported in Overthere way to setup the WinRM shell. Also, Overthere is much more than a WinRM
implementation which we don't need in this case.

This support is considered experimental, even though it has been
successfully tested.

Please review and comment, I'm open to any suggestion and enhancements!