Chef infra 没有这样的食谱

Chef infra 没有这样的食谱,chef-infra,chef-recipe,Chef Infra,Chef Recipe,我用chef创建了一本食谱,当我使用runlist时,我出现了这个错误 Missing Cookbooks: ------------------ No such cookbook: apache ================================================================================ Error Resolving Cookbooks for Run List: =============================

我用chef创建了一本食谱,当我使用runlist时,我出现了这个错误

Missing Cookbooks:
------------------
No such cookbook: apache
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

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

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

System Info:
------------
chef_version=13.8.5
platform=centos
platform_version=7.1.1503
ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
program_name=chef-client worker: ppid=23940;start=18:20:14;
executable=/opt/chefdk/bin/chef-client
我创造了这样的食谱

chef generate cookbook apache 
├── cookbook
│   ├── apache
│   │   ├── Berksfile
│   │   ├── chefignore
│   │   ├── LICENSE
│   │   ├── metadata.rb
│   │   ├── nodes [error opening dir]
│   │   ├── README.md
│   │   ├── recipes
│   │   │   ├── default.rb
│   │   │   └── server.rb
│   │   ├── spec
│   │   │   ├── spec_helper.rb
│   │   │   └── unit
│   │   │       └── recipes
│   │   │           └── default_spec.rb
│   │   └── test
│   │       └── integration
│   │           └── default
│   │               └── default_test.rb
│   └── nodes [error opening dir]
└── nodes [error opening dir]
在我的server.rb中,我刚刚看到了这个

package 'httpd' do
  action :install
end
我试着把我的命令行写成一个多鹰

sudo chef-client -z --runlist recipe["apache::server"]
sudo chef-client -z --runlist "recipe[apache::server]"
sudo chef-client -z --runlist ["apache::server"] 
sudo chef-client -z --runlist "[apache::server]"
sudo chef-client -z --runlist "apache::server"
但我仍然有这个错误

Missing Cookbooks:
------------------
No such cookbook: apache
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

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

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

System Info:
------------
chef_version=13.8.5
platform=centos
platform_version=7.1.1503
ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
program_name=chef-client worker: ppid=23940;start=18:20:14;
executable=/opt/chefdk/bin/chef-client
当我在没有rulist的情况下运行命令时

sudo chef-client -z cookbook/apache/recipes/server.rb
它工作得很好

树命令看起来像这样

chef generate cookbook apache 
├── cookbook
│   ├── apache
│   │   ├── Berksfile
│   │   ├── chefignore
│   │   ├── LICENSE
│   │   ├── metadata.rb
│   │   ├── nodes [error opening dir]
│   │   ├── README.md
│   │   ├── recipes
│   │   │   ├── default.rb
│   │   │   └── server.rb
│   │   ├── spec
│   │   │   ├── spec_helper.rb
│   │   │   └── unit
│   │   │       └── recipes
│   │   │           └── default_spec.rb
│   │   └── test
│   │       └── integration
│   │           └── default
│   │               └── default_test.rb
│   └── nodes [error opening dir]
└── nodes [error opening dir]

这是因为您的cookbook文件名为
cookbook
并重命名
cookbooks
这是因为您的cookbook文件名为
cookbook
并重命名
cookbooks