Skip to content

Instantly share code, notes, and snippets.

@yzl
Last active December 24, 2015 07:49
Show Gist options
  • Save yzl/6766011 to your computer and use it in GitHub Desktop.
Save yzl/6766011 to your computer and use it in GitHub Desktop.
ruby/chef resources

Ruby

If you're just starting with ruby and chef, Greg Albrecht's "enough ruby to be dangerous" is great: http://ampledata.org/enough_ruby_to_be_dangerous.html

When you get to the point of wanting to write "good" ruby, I recommend

  • Principles of Object Oriented Design in Ruby - Sandi Metz
  • Refactoring: Ruby Edition - Jay Fields, Shane Harvie, Martin Fowler
  • Refactoring in Ruby - William Wake, Kevin Rutherford

Chef

I haven't seen a "getting started" guide for chef that I think is wonderful. I actually think this is because chef isn't just programming. It's programming that's about something, namely infrastructure, and it's hard to write well about infrastructure in a way that is both elementary and neutral, which is what people want in "getting started" tutorials. (A different way of saying this is that infrastructure tends not to present a consistent interface that automation code can access.)

things that you will care about in working with chef
  • access to a chef server: keys and permissions, the state of your knife configuration file.
  • workflow: the environment in which you develop chef code, test, and iterate. This is where berkshelf and vagrant come in. My suggestion is to get comfortable with berkshelf and some test framework (chefspec/rspec for unit testing, cucumber for integration testing) and get on with your life. (I can afford to be cavalier about this because everyone else in the world cares about this piece more than I do.)
  • code: cookbooks, recipes, libraries, resources and providers
  • versioning: how to version your code, pull in community code, release code back to the community
  • data: data bags, environment files, roles/role cookbooks
  • package and artifact management: where to get the stuff you're installing, how to manage it
  • how chef maps to and interacts with your infrastructure: what I think of as the good stuff.
community resources provided by opscode
community

Misc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment