【问题标题】:chef not loading nginx厨师不加载nginx
【发布时间】:2013-07-04 03:04:04
【问题描述】:

我正在使用流浪者和厨师。我有一个应该加载和配置 nginx 的配方。

在我的流浪文件中我有:

  chef.cookbooks_path = [ 'chef/cookbooks', 'chef/cookbooks-sources' ]

在我的厨师文件中:

cookbook 'nginx',
  git: 'https://github.com/opscode-cookbooks/nginx.git'

在我的食谱 metadata.rb 中(在食谱资源中):

depends "nginx"

在我的食谱中,我有:

 include_recipe 'nginx' 

Cheffile.lock 看起来像:

DEPENDENCIES
  apt (>= 0)
  cassandra (>= 0)
  curl (>= 0)
  elasticsearch (>= 0)
  java (>= 0)
  java_extras (>= 0)
  phantomjs (>= 0)
  postgresql (>= 0)
  python (>= 0)
  redis (>= 0)
  rvm (>= 0)
  sbt-extras (>= 0)
  windows (= 1.8.6)

当我运行 vagrant up 或 provision 时,我得到以下信息:

[2013-07-02T20:21:40+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook nginx not found. If you're loading nginx from another cookbook, make sure you configure the dependency in your metadata

如何解决我的错误?

【问题讨论】:

    标签: nginx chef-infra vagrant


    【解决方案1】:

    您的 Cheffile.lock 没有列出 nginx 依赖项但还有许多其他依赖项,所以这里缺少一些东西......

    添加 nginx 食谱后,您是否运行了 librarian-chef install(或 update)?你应该有目录chef/cookbooks/nginx/

    Librarian-Chef 也默认安装到 ./cookbooks/,因此在您的设置中,您需要在第一次给它--path="chef/cookbooks"(假设 Cheffile 与 Vagrantfile 位于同一目录) .

    【讨论】:

    • +1 还有一个有用的 vagrant 图书管理员插件,它会自动运行安装/更新。
    【解决方案2】:

    您是否在使用 Berkshelf 之类的食谱管理器?如果没有,你应该调查一下,它可以帮助你解决这个问题。 (我不熟悉chefFile,也许这是一个食谱经理)。

    解决此问题的一个(不太理想的)选项是手动克隆 nginx 食谱存储库并将其放入 chef/cookbookschef/cookbooks-sources,这将解决您的问题。

    【讨论】:

    • Cheffile 由 librarian-chef 使用,它是 berkshelf 的替代工具。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-23
    • 2019-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多