This article is the sixth part in a
series of RubyNation Recaps. The first part was Cannibalize Yourself, and the introductory post contains a list of all the articles posted and coming up. The Joy of Cooking: Whip up a Rails environment with Chef
by Nathen Harvey
Nathen Harvey is the manager of Web Operations for CustomInk, a website that allows you to design and purchase custom apparel for your group or special event. Nathen is the co-organizer of the Washington DC MongoDB Users’ Group and DevOps DC. Nathen contributes to open source projects including the Opscode Chef framework. When not working or hosting meetups, Nathen enjoys going to concerts, drinking craft beer, and over sharing on sites like twitter, untappd, and foursquare.
Resources: Railscasts Pro has a screencast on using Chef-Solo
Admittedly, my notes here turned out more sparse than I’d like them to be. So, I uploaded Nathen’s slides here:
http://rn2012-nharvey-chef.heroku.com/ (use your arrow keys to navigate) Infrastructure as Code
Rebuild your business’ entire production environment with nothing more than a repository, a data backup, and bare metal resources.
Introduction to Chef Declarative : you specify what you need Idempotent : only take action if required Convergent : takes care of itself Building a project in Chef Come up with your policy / specification Abstract the resources in your spec (database, redis, memcached, etc, whatever) Write recipes Package your recipes in cookbooks Apply recipes to nodes Group things into roles What is Chef?
It is a Server, an API that you call into, and a Web UI
Client - chef-client Command line tool - knife Inspection library - ohai REPL - shef (think irb)
Chef, knife, and ohai are extendable.
The Chef community has lots of addons. Deployment chef-solo (disk or url) no central server, authentication, authorization, search, or persistence chef server open source, run it yourself, complicated setup and management hosted chef opscode runs the chef infrastructure for you (monthly price plans) up to 5 nodes for free private chef managed by opscode, monthly fees, installation fee Configure your client
Check your keys, knife config, chef-repo directory, and validation files
“Which clients are allowed to connect to this hosted chef?”
$ knife client list Provision a server for your Rails App
You can run it locally to manage your development environment
$ knife ec2 server create $ knife rackspace server create
Vagrant (everyone should be using
Cookbooks for Apache, Passenger, MySQL, Rails application
passenger_apache2 (community site has it for download, use the knife command) mysql (community site, knife command grabs dependencies for you) write your web & database cookbooks
To continue, please refer to Nathen’s slides:
http://rn2012-nharvey-chef.heroku.com (use your arrow keys to navigate) Have a comment or question? Send us a note. It won't be shown here and email isn't required, unless you'd like a
Send a note