Automating Windows & Test Environments

Using Packer, Vagrant, and Puppet for versionable, repeatable Windows testing

Dan Fitch

Things I'm about to talk about

  • Why is automating Windows a pain?
  • Packer
  • Vagrant
  • Puppet
  • Q&A

Please feel free to interrupt AND/OR tell me to slow down.

automating windows

HOW DOES IT WORK???

Ops vs. Development/Testing

  • VMWare ESX (vdev-blah-01)

    slow, eats expensive resources, eats ops time

    versus

  • Local testing

    fast, local resources, no other people required

  • AND we want them to all match up across environments

HOW?

Packer

  • Creating base "box" files
  • Metadata about the box, plus scripts to set it up
  • Supports ESX, VirtualBox, Amazon EC2, DigitalOcean, Docker, blah blah blah.

Packer in action

  • git clone ssh://git@bitbucket:7999/auto/packer-windows.git packer1
  • Show a JSON definition and some scripts
  • Run it!
    • packer build -force -only=virtualbox-iso .\dan10.json
    • vagrant add dan10.box --name dan10

Vagrant

  • Repeatable
  • Tiny, versionable
  • Per-person
  • Works for Linux, any version of Windows, etc.
  • Solves:
    • "Works on test but we don't know why"
    • "Uhhh, how do I test this locally"
    • "This app has a crazy chain of server dependencies, how do we automate/document/test the environment?"

Vagrant in action

  • git clone ssh://git@bitbucket:7999/auto/packer-windows.git buildagent1
  • Show a Vagrantfile
  • Run it!
    • vagrant up
    • librarian-puppet install
    • vagrant up

Puppet

  • What does it do?
  • Roles and profiles
  • Puppetfiles, modules, and dependencies (r10k, librarian-puppet)
  • More than a wrapper around package management

Puppet in action

  • Show some Puppet code
  • Run it!
    • Oh wait, Vagrant already did.
  • Working to automate TeamCity

THE END

(or, Q&A)

Thanks for your time. Let's share more knowledge, yo!