Dev Ops Crash Course - Day Five

Published Friday, March 24, 2017

Notes from day one, day two, day three, and day four.

Chef Chat

What is Chef?

  • Scripts written in Ruby to provision a server.
  • Server setup
  • Infrastructure automation
  • Server configuration management

What’s important to manage?

  • Software versioning
  • Uniformity and consistency across machines
  • Reproducability
  • Idempotency

What problems are we solving?

  • Efficient setup
  • Preserves history
  • Prevents environment issues resulting from inconsistencies among envs

Alternatives to Chef?

How We’ve Structured Our Cookbooks

Rely on inheritance. All cookbooks include base cookbook, which makes sure we always have security standards, base stuff in place on all boxes.

Wrapper cookbooks let us have a general template we can extend with app-specific details.

Idiosyncracies of Chef

Conventions aren’t very clearly defined. Easy to define attributes all over the place (ex. in your recipes, in attributes directory, etc.)

Cookbooks have many recipes, but in our chef repo, we tend to only have one recipe per cookbook (the default recipe).

Community cookbooks

When using community cookbooks, probably want to wrap rather than fork. After a certain amount of customization, merits writing your own. We’ve had some work out w/o any customization (Rabbit), but others we started from then ended up writing our own (Ruby cookbook).

Plus it’s hard to use a community cookbook if you don’t understand server setup to begin with, so worth it to gain knowledge by writing your own.

Another good exercise: set up servers by hand (like we did on day one.

Testing cookbooks

ChefSpec

ServerSpec