[英]Chef zero can't find cookbook during kitchen test run
這讓我發瘋了,我剛開始在新圖像(win10)上使用廚師,並且由於某種原因在使用廚房測試食譜時找不到食譜? 嘗試了對這個問題的回答: Chef solo can't find cookbook during kitchen test run它拋出一個錯誤說“你的 Berksfile 包含多個名為‘printserver’的條目。請刪除重復的依賴項,或將它們放在不同的組中。]默認情況下-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
將以下內容添加到 Berksfile(在“元數據”下):
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
。 如果它仍然出現問題,請告訴我。
我通過向 Berksfile 添加metadata
行解決了這個問題。
我最終按順序做了什么:
首先出了什么問題? 我不知道。
附帶說明一下,如果有人對使用廚師創建 Windows 2012 打印服務器有任何好的參考,那將非常有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.