chef-infra - 使用 Berkshelf 时无法找到 Recipe 模板

标签 chef-infra chef-solo berkshelf

我正在使用 Chef-solo 并使用 berkshelf 维护社区 Recipe 。最近使用berkshelf安装了iptables Recipe ,当我运行chef-solo时它抛出了以下错误。

RuntimeError
------------
File templates/default/rebuild-iptables.erb does not exist for cookbook iptables

Resource Declaration:
---------------------
# In /home/directfn/.berkshelf/cookbooks/iptables-2.0.1/recipes/default.rb

 35: template '/usr/sbin/rebuild-iptables' do
 36:   source 'rebuild-iptables.erb'
 37:   mode '0755'
 38:   variables(
 39:     hashbang: ::File.exist?('/usr/bin/ruby') ? '/usr/bin/ruby' : '/opt/chef/embedded/bin/ruby'
 40:   )
 41: end
 42: 

但我可以看到模板源就在那里。

[root@euca-172-16-10-197 chef-repo]# ls /home/directfn/.berkshelf/cookbooks/iptables-2.0.1/templates/default/rebuild-iptables.erb 
/home/directfn/.berkshelf/cookbooks/iptables-2.0.1/templates/default/rebuild-iptables.erb

但是如果我将 iptables Recipe 复制到我剩余的 Recipe 所在的位置,它就像一个魅力。 我正在使用 30 多本使用 Berkshelf 的其他社区 Recipe ,没有任何问题。

有人知道这里发生了什么吗?

提前致谢

solo.rb 文件

file_cache_path "/home/directfn/devops/chef-solo"
cookbook_path [
  "/home/directfn/devops/chef-repo/cookbooks",
  "/home/directfn/.berkshelf/cookbooks"
  ]
data_bag_path "/home/directfn/devops/chef-repo/data_bags"
environment "development"
environment_path "/home/directfn/devops/chef-repo/environments"

Json 属性文件:

{
  "name": "phoenix_new",
  "description": "",
  "java": {
        "install_flavor": "oracle", 
        "jdk_version": 7,
        "oracle": {
                "accept_oracle_download_terms": true
        }
  },
  "phoenix": {
        "tag": "dbfs_release_0"
  },
  "run_list": [
                "recipe[phoenix::simple]"
  ],
  "env_run_lists": {

  }
}

最佳答案

chef-solo 无法直接使用 .berkshelf/ 下的 Recipe 。您应该使用 berksvendor 将它们重新格式化为 Chef 可以更好处理的结构。

关于chef-infra - 使用 Berkshelf 时无法找到 Recipe 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34058731/

相关文章:

python - Chef 安装 uwsgi libiconv.so.2 没有那个文件或目录

ruby - Vagrant with Chef - 配置 VM 时出错

ruby - apt Recipe 不会安装在我的 Recipe 中

chef-infra - 在centos上安装berks

chef-infra - 如何从 Chef 自定义资源内部确定 Java 版本而不将其作为参数传递?

ruby - Chef 的 deploy_revision/before_symlink 什么时候运行?

chef-solo - chef-solo --daemonize 是如何工作的,有什么意义?

mysql - Vagrant : chef_solo | how i can change log path from mysql server and mongodb?

amazon-web-services - Chef : HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory

mysql - Chef 认为没有满足依赖关系