我如何判断berkshelf是否正在连接到我的厨师服务器



我正试图与chef一起使用berkshelf来提供Vagrant机器。这是在Windows 7上运行的。我安装了Berkshelf作为厨师DK的一部分。报告版本3.2.3。由于找不到一些烹饪书,我的流浪食物供应失败了。这是我的Berksfile 的相关部分

source "https://api.opscode.com/organizations/createthegood"
#source "https://api.berkshelf.com"
metadata
cookbook "drupal_site"
cookbook "al_base" 

当我运行berks安装时,它无法索引源:

D:RobVMsctg_cookbook>berks install
Resolving cookbook dependencies...
Fetching 'artifact' from git://github.com/RiotGames/artifact-cookbook.git (at master)
Fetching 'ctg_cookbook' from source at .
Fetching 'drush' from git://github.com/jenkinslaw/chef-drush.git (at 0a567e2)
Fetching 'php-fpm' from git://github.com/yevgenko/cookbook-php-fpm.git (at master)
Fetching cookbook index from https://api.opscode.com/organizations/createthegood...
D:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/berkshelf-api-client-1.2.1/lib/berkshelf/api
_client/connection.rb:67:in `block in universe': undefined method `each' for #<String:0x3fdc4e8>
 (NoMethodError)
        from D:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/berkshelf-api-client-1.2.1/lib/
berkshelf/api_client/connection.rb:66:in `tap'
        from D:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/berkshelf-api-client-1.2.1/lib/
berkshelf/api_client/connection.rb:66:in `universe'
        from D:/opscode/chefdk/embedded/apps/berkshelf/lib/berkshelf/source.rb:22:in `build_univ
erse'
        from D:/opscode/chefdk/embedded/apps/berkshelf/lib/berkshelf/installer.rb:21:in `block (
2 levels) in build_universe'

然而,knife在其配置的服务器上发现了食谱:

C:Users29007>knife cookbook list help
7-zip                  1.0.2
activelamp_composer    0.0.1
activelamp_drupal      0.0.4
activelamp_symfony     0.0.1
al_base                0.0.1

我想,也许它berkshelf没有从knife中获取配置信息(也许像密钥文件)。但我似乎无法想出一种方法来验证这一点。我下一步该怎么诊断?

我不相信Hosted Chef提供了可以在Berksfile中使用的Berkshelf API。Berkshelf需要与一个Berkshelf api进行对话,该api为Chef Server的所有食谱编制索引,然后能够进行依赖关系解析。这就是block in universe失败的原因,因为berkshelf-API中有/universe API资源。看起来主厨不支持。

通常,在Berksfile中,您将内部berkshelf-api放在第一位,将社区Berksheld-api放在第二位。在这种情况下,社区api现在位于https://supermarket.chef.io.如果你的食谱只依赖于超市上的食谱,你就不必建立自己的伯克郡API。

如果你确实计划根据自己的食谱编写食谱,最好的方法是建立一个berkshelf api服务器。有一本食谱,你可以把它设置好,指向你的主厨组织。你也可以建立自己的超市,也提供伯克希尔API。

最新更新