Deploying JumpSquares with Chef Cookbooks

Over the past week, I started learning Chef. There are a few different configuration management toolsets out there such as Puppet, SaltStack, and Ansible. But Puppet and Chef have majority amount of market share and use Ruby as its code base so it made sense for me to start there. There's no point in starting a project unless you have a goal to accomplish so after I read more about Chef cookbooks, recipes, attributes, etc it seemed like making a JumpSquares cookbook would be a good place to start.

 

Skip the blah blah and see the code at chef-jumpsquares or read on for the complete back story.

 

The setup of Chef is simple and only takes about an hour or two to complete. After the server is up and a node has been added, that's where the fun begins. I began my involvement with looking around for cookbooks that use the same components that are needed in the JumpSquares appliance model. Cookbooks such as postgres for database, rvm for ruby, and nginx for web/application servers were already available and made my job starting out much easier.

 

Read more: Deploying JumpSquares with Chef Cookbooks

Chef Cookbook and Recipe for Thin + Nginx with Rails

For simplicity, I deploy thinnginx for most of my rails applications. Thin is lighter weight than Passenger and the combo makes it more favorable than running Apache. I began learning Chef and saw nothing for thin existed so I attempted to make a cookbook.

 

If you don't want to read any more about this, then jump over to the code on github chef-thin_nginx.

 

This cookbook will install thin as a gem and complete a configuration. While 'nginx' will be installed from package and installed as a normal service.

 

To make the 'thin' installation from gem work properly, 'rvm' is required. rvm has a shell interface that is used to install the service from the gem. I previously tried to install thin from source and it wouldn't work correctly because 'rake' tasks are necessary gems that aren't loaded into the internal 'chef' gemset. In addition, I tried to install the thin gem to chef's internal gemset, but I received lots of errors when it came to postgresql gems. That is why rvm is necessary. rvm will install version 1.6.1 of thin unless you change the parameters. This was tested with 1.6.1 so it will work.

Read more: Chef Cookbook and Recipe for Thin + Nginx with Rails