0
votes

I have a bunch of cookbook files, some defined as recipes and some defined as roles. So for example the top level role is:

run_list( "role[el-drupal-cookbook::drupal_lamp_dev]" , "recipe[drupal-site-jnl-el-cookbook::default]" )

The intent of the above is to set up the server as a drupal lamp server and then install a specific website on it.

I'm calling it all from Vagrant, using an add_role request, and librarian-chef pulling all the bits together. The cookbook path is "cookbooks", and the role_path is "roles".

When this is executed, it finds the top level role (which is in the same directory as the Vagrantfile) but not those that are in different cookbooks.

As roles and recipes are both stored in cookbooks that the cookbook path should serve, so I'm obviously missing something. Can anyone help?

I've attached the error message below:

[2013-10-24T14:37:28+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[git]", "role[drupal-jnl-el]", "recipe[drupal-site-jnl-el-cookbook::disable-cdn]"] from JSON
[2013-10-24T14:37:28+00:00] ERROR: Role el-drupal-cookbook::drupal_lamp_dev (included by 'role[drupal-jnl-el]') is in the runlist but does not exist. Skipping expand.

================================================================================
Error expanding the run_list:
================================================================================


Missing Role(s) in Run List:
----------------------------
* el-drupal-cookbook::drupal_lamp_dev included by 'role[drupal-jnl-el]'


Original Run List
-----------------
* recipe[apt]
* recipe[git]
* role[drupal-jnl-el]
* recipe[drupal-site-jnl-el-cookbook::disable-cdn]

EDIT:

The vagrantfile says:

# define where things have been collected together by librarian-chef
chef.cookbooks_path = ["cookbooks"]
chef.roles_path = ["roles"]

# this installs most of the infrastrucutre required to support a drupal instance
chef.add_recipe "apt" # add this so we have updated packages available
chef.add_recipe "git"
# chef.add_recipe "openvpn"  # vpn needed, but using tunnelblick on mac host instead.

# This role represents our default Drupal development stack.
chef.add_role   "drupal-jnl-el"
2
Could you please share that part of your Vagrantfile? I'm wondering, why you say that your roles are in the cookbooks. For roles there should be a *.rb file in roles/ each. For cookbook, you have subdirectories below cookbooks/.StephenKing
The vagrantfile fragment attached. In the source (that lib-chef collects) there are roles and recipes directories beside each other, with appropriate files in each. L-C collects these into the cookbooks folder...rivimey

2 Answers

1
votes

It says

Missing Role(s) in Run List:
----------------------------
* el-drupal-cookbook::drupal_lamp_dev included by 'role[drupal-jnl-el]'

This means that roles/drupal.{rb,json} tries to include a role[el-drupal-cookbook::drupal_lamp_dev], which should be a recipe[el-drupal-cookbook::drupal_lamp_dev] however.

0
votes

You need to add that role to your knife role list, try

knife role from file your_role_name.js

By default the command will look for that role in roles/ directory (in your project root)