packer-community / packer-windows-plugins

A suite of Packer plugins for provisioning Windows machines
113 stars 20 forks source link

I'd like to merge this into mainstream Packer, may I? #63

Open mitchellh opened 9 years ago

mitchellh commented 9 years ago

Hello!

First, thank you so much for maintaining this repository. I can tell from Google searches that it has helped a great many people and I'm incredibly appreciative.

Just tonight I got WinRM into Packer (thanks to contributions from sneal, masterzen, and others), and I also just opened a PR to support Windows AWS instances as well. IT IS THE WEEKEND OF WINDOWS!

I'd like to also bring in all of these provisioners here. Thoughts?

mefellows commented 9 years ago

Ahh, my thoughts are that this is awesome and would love to make that happen! I suppose my first question is how can we help?

Have you had a chance to look through the code and see how that might be achieved? Bringing this into Packer would have some obvious upshots in terms of removing duplication and so on and was always the ultimate intention as it would put this capability in front of more people.

P.S. Sorry to hear about your weekend ;)

jen20 commented 9 years ago

@mitchellh there's a branch on my fork (no PR yet) which already did the work to convert this to aws-sdk-go, and another couple of bits (e.g. generating out user data to enable secure WinRM with a known certificate) - that may be a good place to start. It needs some clean up work to bring it in line with master here though, but likely quicker than converting from scratch.

(also - good to finally meet you at QCon the other day!)

mitchellh commented 9 years ago

@jen20 Thanks i'll take a look. Also thanks for your blog post bringing this all together. I used that as a blueprint while working on this stuff. :)

mitchellh commented 9 years ago

Done, PR here: https://github.com/mitchellh/packer/pull/2243

jen20 commented 9 years ago

:+1: this will make it way easier for people to use!

James

mefellows commented 9 years ago

So basically @mitchellh, i think its only fair we come clean about some issues that you've inherited (thanks!) to make sense of things. There are really only 2 main ones at the moment:

  1. 54 there was a fairly recent change in the underlying WinRM library that has impacted our ability to perform restarts/shutdowns - due to the way WinRM works there is a call that performs an action (e.g. restart/stop WinRM etc.) and a subsequent call to check the response from that action - this fails with a non-zero exit code if the request was to kill the thing its trying to communicate to! Previously, it didn't. So we need a better, more reliable way of detecting a restart, and waiting for an absence of a connection may be all we need to fix this. This effects custom shutdown commands like using sysprep (see #58) and the restart-windows provisioner, and will need to be implemented in the plugins here and ported to your PR (or vice versa).

  2. 25 This is more of an intermittent bug that we've never quite been able to put our fingers on, but does appear to be more prevalent on Windows 2008. Fortunately this is likely to be part of the winrmcp project so shouldn't impact your PR.

I'm working on tidying up the others so we have a clean backyard.

As a general note, the current thinking is that we'll support the plugins here if only until the dust settles, and then look to sunset any plugins/functionality moved into Packer itself once it's made publicly available.

Unfortunately, to set expectations the timing is not great on a personal level - from the end of next week I'm off to US + Canada for 5 weeks (sing out if you're up for :beers:) and have very little time to dedicate to this. I'll do what I can though!

mitchellh commented 9 years ago

@mefellows We fixed #54 in a follow-up PR by changing the command that is used. It is slightly less robust but happens to work. You can check it out on Packer master.

mefellows commented 9 years ago

Thanks @mitchellh, just looking at it now to see if I can find a more permanent one - it is after midnight though so... :/