
[英]chef template gives No such file or directory @ rb_sysopen Errno::ENOENT
[英]search template file recursively under template directory
我在我的食谱中的模板目录下创建了3个目录。 所有目录都包含模板(.erb)。 当我在配方中使用模板时,我给出的是源“文件名”。
template "file" do
source "file1.erb"
end
Chef正在默认文件中查找.erb文件,而file1.erb在dir之一中。 因此,它说在template / default中没有file1.erb。
下面是结构:
模板
default
dir1
dir2
dir3
我希望主厨应递归搜索模板。 有人可以帮我这个忙吗?
简短的答案,你不能。
模板目录下的目录结构具有文档中描述的含义,可在同一资源的不同操作系统上使用。
如果希望将内容组织在template目录下,则必须在模板资源中指定路径,如下所示:
template "file" do
source "dir1/file1.erb"
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.