错误解决了运行列表的食谱:缺少食谱:没有这样的食谱

时间:2017-08-08 13:27:06

标签: ruby vagrant chef chef-recipe cookbook

我第一次学习厨师。在这一点上,我试图通过厨师 - 客户端运行烹饪书而不是单一食谱。但我收到错误消息说“缺少食谱”。我已经尝试多次调试,正如你可以看到使用tree命令,很明显有一个名为apache的cookbook。

我也尝试过运行其他的食谱工作站,但这也给出了同样的错误

请帮忙。让我知道我哪里出错了。

[vagrant@localhost ~]$ 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
[vagrant@localhost ~]$ 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)
[vagrant@localhost ~]$

2 个答案:

答案 0 :(得分:0)

尝试

chef-client -z -o apache

答案 1 :(得分:0)

您似乎已复制该行,包括印刷(?)引号。看看输出:

  

为运行列表解析cookbook:["“apache :: server”"]

所以在shell命令中修复这些引号:

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