这是我的设置
cookbooks /
supervisord /
definitions /
supervisord_group.erb
templates /
process_group.conf.erb
my_app /
recipes /
default.rb
在cookbooks/supervisord/definitions/supervisord_group.erb
我有这个:
define :supervisord_group, :programs => [], :enable => true do
include_recipe "supervisord::install"
if params[:enable]
template "#{node[:supervisord][:conf_dir]}/#{params[:name]}_group.conf" do
source "process_group.conf.erb"
variables({
:name => params[:name],
:programs => params[:programs].join(",")
})
owner node[:user]
group node[:group]
mode 0755
end
end
end
在 cookbooks/my_app/recipes/default.rb 我有这个:
supervisord_group "myapps" do
programs ["test1", "test2"]
end
问题是当我运行它时,我得到一个错误,它无法找到模板process_group.erb.conf
。这是输出:
Cookbook 'my_app' (0.0.0) does not contain a file at any of these locations:
templates/ubuntu-10.04/process_group.conf.erb
templates/ubuntu/process_group.conf.erb
templates/default/process_group.conf.erb
如果我的supervisord_group
定义是引用模板的定义,为什么它期望my_app
食谱有它?有任何想法吗?