Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Racker - Making Packer Templates Easier

Anthony Spring
September 19, 2014

Racker - Making Packer Templates Easier

This is a derivation of my previous Vagrant talk, including a more in depth presentation of why I developed Racker and how we use Racker at Yieldbot.

Anthony Spring

September 19, 2014
Tweet

More Decks by Anthony Spring

Other Decks in Technology

Transcript

  1. What is Packer? “Packer is a tool for creating identical

    machine images for multiple platforms from a single source configuration.”
  2. Builders Define the high level configuration settings for the box

    that is getting built. DigitalOcean, Docker, EC2, GCE, OpenStack, QEMU, VirtualBox, VMWare
  3. Provisioners A set of ‘scripts’ that get applied to each

    an image. Ansible, Chef Solo, File Uploads, Salt, Shell Scripts
  4. Post Processors Determines the type of output artifact generated and

    where that artifact is placed. Docker Import, Docker Push, Vagrant, vSphere
  5. Putting it all together Build several images in parallel. Target

    specific builders (inclusive/exclusive). Everything used to build the box is in source control. Its really freaking sweet!
  6. Packer @ Yieldbot Primarily CentOS/RHEL Build universal images for Docker,

    EC2 AMI, VirtualBox, VMware ESXI, and VMware Fusion. Ability to provision with Chef Ability to test images before shipping
  7. Evolution Created a single primary Packer template Change to the

    base template — required changes to all of its derivatives. Variables could only take us so far. Not very easy to merge the Packer JSON template format. Very difficult to comment JSON
  8. Racker Determinant merging of templates DRY templates Provide a method

    of knocking out hash values Ability to add comments Its just Ruby!
  9. Deep Merge The base overlays the top and then the

    bottom to achieve the desired result.
  10. What is grey matter? Grey matter is the area of

    your infrastructure where you have the least amount of confidence.
  11. ServerSpec Guts Prep the environment for ServerSpec Upload Rakefile, Gemfile,

    etc. Upload individual specs Run the specs Cleanup
  12. Anthony Spring Minister of DevOps Culture [email protected] @devopsanthony The opinions

    expressed here represent my own and not those of my employer.