Вопрос

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"
Это было полезно?

Решение

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.

Другие советы

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)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top