Customizing your Scalarium Cloud using Chef: Configuring Custom Cookbooks

Now that we have our custom cookbook in place, at least the recipe to configure Redis, it's time to tell Scalarium where
to find them and then, to start the instance. You can manage a set of cookbooks per cloud. Scalarium expects them to be
in a Git or Subversion repository, just like your applications. When you're on a cloud's page, select "Manage
Cookbooks" from the "Actions" menu in the upper right corner:

Manage Cookbooks

On the following page, we're configuring the Git repository to fetch our cookbooks from. Our example cookbooks
repository is public, so there's no need for us to specify an SSH key, and we can leave that field empty. If you want
your cookbooks fetched from a different branch or a specific revision, you can specify that too.

Add Cookbook Repository

Next, we'll tell Scalarium which recipes to run when setting up the Redis instance. Back on the cloud's page, select
"Custom Recipes" on the menu for the role "Redis".

Add Custom Recipes

Add the recipe redis::server to the list of recipes to be run on the "setup" event. The name redis::server refers to the name of the cookbook, and the recipe in it. If you just specify redis, Chef expects a recipe called default.rb to be in the cookbook's recipes directory. Recipes can be empty, and sometimes it's a good idea to just add an empty default recipe, so you can easily load the cookbook's attributes in other cookbooks.

Setup Recipes

Now we're ready to start the instance. Go ahead and start it right up. When it's done, it should be running a fully
configured Redis server. You can log in via the SSH button and see for yourself by running
ps ax | grep redis-server in the terminal window. Wait, did you just log in to an instance through the Scalarium web interface? I think you did! A handy feature, that one.

SSH

Terminal

Neat! A Redis server up and running, available for consumption by our Rails application server. Before we dive into configuring them, let's have a look at how you can specify custom attributes for a cloud to overwrite the cookbook's defaults.

Next step: Overriding Default Attributes

Or go back to Writing a Cookbook to set up Redis