流浪者 - 厨师角色:厨师独奏没有在我的食谱中找到角色

时间:2013-10-24 15:20:10

标签: chef vagrant chef-solo cookbook

我有一堆食谱文件,一些定义为食谱,一些定义为角色。例如,顶级角色是:

run_list(   “角色[el-drupal-cookbook :: drupal_lamp_dev]”,   “食谱[Drupal的站点JNL-EL-食谱::默认]” )

上述目的是将服务器设置为drupal lamp服务器,然后在其上安装特定网站。

我是从Vagrant调用它,使用add_role请求,而librarian-chef将所有位都拉到一起。 cookbook路径是“cookbook”,role_path是“角色”。

执行此操作时,它会找到顶级角色(与Vagrant文​​件位于同一目录中),但不会查找不同烹饪书中的角色。

由于角色和食谱都存储在烹饪书中,食谱路径应该服务,所以我显然遗漏了一些东西。有人可以帮忙吗?

我附上了以下错误消息:

[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]

编辑:

vagrantfile说:

# 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 个答案:

答案 0 :(得分:1)

它说

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

这意味着roles/drupal.{rb,json}尝试包含role[el-drupal-cookbook::drupal_lamp_dev],但应该是recipe[el-drupal-cookbook::drupal_lamp_dev]

答案 1 :(得分:0)

您需要将该角色添加到您的刀角色列表中,尝试

knife role from file your_role_name.js

默认情况下,该命令将在roles /目录(在项目根目录中)中查找该角色