这让我发疯,我刚刚开始使用厨师的新图像(win10),并且出于某种原因,当使用厨房测试食谱时,它找不到食谱?尝试了对这个问题的回答:Chef solo can't find cookbook during kitchen test run 它会抛出一个错误,说“你的Berksfile包含多个名为'printserver'的条目。请删除重复的依赖项,或者将它们放在不同的组中。”在default-win-2012r2-standard-amd64-nocm上 厨房版1.17.0
----> Converging <default-win-2012r2-standard-amd64-nocm>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 6.3.1...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to <default-win-2012r2-standard-amd64-nocm>
Starting Chef Client, version 13.4.24
resolving cookbooks for run list: ["printserver"]
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================
Missing Cookbooks:
------------------
No such cookbook: printserver
Expanded Run List:
------------------
* printserver
System Info:
------------
chef_version=13.4.24
platform=windows
platform_version=6.3.9600
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client
Running handlers:
[2017-09-20T13:38:53-07:00] ERROR: Running exception handlers
Running handlers complete
[2017-09-20T13:38:53-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 03 seconds
[2017-09-20T13:38:53-07:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
[2017-09-20T13:38:53-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-09-20T13:38:53-07:00] FATAL: Net::HTTPServerException: 412 "Precondition Failed"
------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Converge failed on instance <default-win-2012r2-standard-amd64-nocm>.
Please see .kitchen/logs/default-win-2012r2-standard-amd64-nocm.log for more details
Please see .kitchen/logs/kitchen.log for more details
Also try running `kitchen diagnose --all` for configuration
答案 0 :(得分:0)
将以下内容添加到Berksfile(在&#34;元数据&#34;下):
cookbook 'printserver'
澄清:如果这是您创建的食谱,您需要做一些事情:
如果你有本地食谱,你需要添加path: '../printserver/'
或类似的东西。它需要相对于当前路径。
如果它在github上,请添加git: 'git@github.com/my_org/printserver.git', 'master'
所以,把所有这些放在一起,在本地系统上使用相对路径:
cookbook 'printserver', path: '../printserver'
对于git:
cookbook 'printserver', git: 'git@github.com/your_org/printserver.git', 'master'
最后,运行berks install
。如果它仍然存在问题,请告诉我。
答案 1 :(得分:0)
我通过向Berksfile添加metadata
行来解决此问题。
答案 2 :(得分:-1)
我最终按顺序做了什么:
首先出了什么问题?我没有线索。
另外,如果有人对使用厨师创建Windows 2012打印服务器有任何好的参考,那将非常有帮助。