2017-08-08 166 views
0

我正在學習廚師第一次。在這一點上,我試圖通過廚師客戶端運行食譜而不是單一食譜。但我收到錯誤消息,說「缺少食譜」。我試過多次調試,就像你看到的使用樹命令一樣,很明顯有一個名爲apache的食譜。錯誤解決烹飪書的運行列表:缺少烹飪書:沒有這樣的烹飪書

我試圖運行其他菜譜工作站爲好,但給了同樣的錯誤

請幫助。讓我知道我要去哪裏錯了。

[[email protected] ~]$ tree 
. 
├── cookbooks 
│   ├── apache 
│   │   ├── Berksfile 
│   │   ├── chefignore 
│   │   ├── metadata.rb 
│   │   ├── README.md 
│   │   ├── recipes 
│   │   │   ├── default.rb 
│   │   │   └── server.rb 
│   │   ├── spec 
│   │   │   ├── spec_helper.rb 
│   │   │   └── unit 
│   │   │    └── recipes 
│   │   │     └── default_spec.rb 
│   │   └── test 
│   │    └── recipes 
│   │     └── default_test.rb 
│   └── workstation 
│    ├── Berksfile 
│    ├── chefignore 
│    ├── metadata.rb 
│    ├── README.md 
│    ├── recipes 
│    │   ├── default.rb 
│    │   └── setup.rb 
│    ├── spec 
│    │   ├── spec_helper.rb 
│    │   └── unit 
│    │    └── recipes 
│    │     └── default_spec.rb 
│    └── test 
│     └── recipes 
│      └── default_test.rb 
├── generate 
├── hello.rb 
├── help 
│   ├── Berksfile 
│   ├── chefignore 
│   ├── metadata.rb 
│   ├── README.md 
│   ├── recipes 
│   │   └── default.rb 
│   ├── spec 
│   │   ├── spec_helper.rb 
│   │   └── unit 
│   │    └── recipes 
│   │     └── default_spec.rb 
│   └── test 
│    └── recipes 
│     └── default_test.rb 
└── nodes 
    └── localhost.json 

24 directories, 28 files 
[[email protected] ~]$ sudo chef-client -z --runlist 「apache::server」 
[2017-08-08T13:16:05+00:00] WARN: No config file found or specified on command line, using command line options. 
Starting Chef Client, version 12.14.89 
resolving cookbooks for run list: ["「apache::server」"] 

================================================================================ 
Error Resolving Cookbooks for Run List: 
================================================================================ 

Missing Cookbooks: 
------------------ 
No such cookbook: 「apache 

Expanded Run List: 
------------------ 
* 「apache::server」 

Platform: 
--------- 
x86_64-linux 


Running handlers: 
[2017-08-08T13:16:07+00:00] ERROR: Running exception handlers 
Running handlers complete 
[2017-08-08T13:16:07+00:00] ERROR: Exception handlers complete 
Chef Client failed. 0 resources updated in 01 seconds 
[2017-08-08T13:16:07+00:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out 
[2017-08-08T13:16:07+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
[2017-08-08T13:16:07+00:00] ERROR: 412 "Precondition Failed" 
[2017-08-08T13:16:07+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
[[email protected] ~]$ 

回答

0

似乎已複製該行包括印刷(?)的報價。看看輸出:

解決了運行列表的食譜: 「‘阿帕奇::服務器’」]

所以解決這些報價在shell命令:

$ sudo chef-client -z --runlist "apache::server" 
+0

我不知道我是否正確理解你,但是,我將命令更改爲 sudo chef-client -z --runlist'apache :: server' 並且它按預期工作 –

+0

你做到了。很高興向您解釋。 – StephenKing

0

嘗試用

chef-client -z -o apache