I've been using Packer to build vSphere templates in my lab for a while now. One problem I had for ages was that I wanted my Packer builds and scripts to be in a public repository as I don't want to hoard my knowledge and experience. What I didn't want to share, however, were the license keys from my MSDN subscription or my commonly used passwords etc.

I created a system of text replacements using sed to automate the process a bit. And while I still use that for the passwords, it turns out that that there's a simpler solution for Microsoft license keys.

KMS client setup keys can be used to get the OS installation done. They have to be replaced later to activate Windows after cloning and to comply with licensing terms, but they get the job with Packer done. And, as they're listed right there on Microsoft's site, then it's not like I'm sharing anything dodgy.

KMS client setup keys
Keys needed to activate Windows products from a KMS server