Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I cal a custom recipe from my default recipe? If I try

recipe 'my-base-server'

I get an error 1 argument for 0

What I want to achieve is a logical division of my recipe into base, web-server and app-server. I will setup each recipe as described in the answer below but I want to include these recipes in my default recipe. What I can't figure out is probably dead simple, is how to call the web-server recipe I write from the default recipe. The web server recipe will in turn call the nginx recipe as described below. I am using Berkshelf. I don't want to use roles and nodes. I can't find documentation about how to do this with only wrapper recipes.

Essentially, all I want to know is very basic, how to define a run list in a recipe. I can't find a reference anywhere that doesn't do it from a role or node.

share|improve this question

You can use wrapper cookbooks like so (in this case, deploying a Tomcat app):

node.set['java']['install_flavor'] = 'oracle'
node.set['java']['oracle']['accept_oracle_download_terms'] = true
node.set['java']['jdk_version'] = 7

node.set['tomcat']['base_version'] = 7
node.set['tomcat']['loglevel'] = 'WARN'     # default is 'INFO'

tempdir     = node['appname']['temp_dir']
configdir   = node['appname']['config_dir']
loggingconf = node['appname']['logging_conf'] 
grailsenv   = node['appname']['grails_env']
appdir      = node['appname']['app_dir']

if Chef::Config[:solo]
    node.set["tomcat"]["keystore_password"] = 'throwawaypassword'
    node.set["tomcat"]["truststore_password"] = 'throwawaypassword'

include_recipe "java"
include_recipe "tomcat"
share|improve this answer
In what file is this code? – markhorrocks Feb 9 '14 at 6:56
This is in a custom cookbook recipe, in this example, the cookbook is called 'appname'. Honestly, it sounds like you should spend some time on – gWaldo Feb 10 '14 at 0:30
up vote -1 down vote accepted

I just needed to namespace the recipe like this

include_recipe 'my-rails-server::web-server'

where the recipe name was


My problem was that I had tried this after creating a cookbook by hand and it didn't work. After I used

berks cookbook my-rails-server

it worked fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.