厨师刀配置

Chef knife configuration

我觉得问这个问题很愚蠢,因为它似乎对大多数人来说都完美无缺,但我无法解决在 RHEL 6 上设置 Chef 服务器 12 和我的 ChefDK 0.6.0 后遇到的以下问题 mac.

Chef 服务器设置按照文档中的描述顺利进行,完全没有错误。当我想使用我的 machine 作为工作站将食谱推送到服务器时,我总是收到错误 "The object you are looking for could not be found"。根据其他 stackoverlfow 帖子 (0, 1, 2),这可能是由于 knife.rb 中的配置问题。尽管如此,我还是使用 "knife configure" 设置了 knife.rb 文件,并仔细检查了路径中的任何拼写错误。此外,根据 knife.rb 文档页面,我正确使用了这些属性。

有人知道是什么导致了这个问题吗?

log_level                :info
log_location             STDOUT
node_name                "nodermatt"
client_key               "/Users/odermatt/chef-repo/.chef/nodermatt.pem"
validation_client_name   "Adobe-validator.pem"
validation_key           "/Users/odermatt/chef-repo/.chef/Adobe-validator.pem"
chef_server_url          "https://sj1010005158157.corp.adobe.com:443/organizations/Adobe"
syntax_check_cache_path  "/Users/odermatt/chef-repo/.chef/syntax_check_cache"
cookbook_path [ "/Users/odermatt/chef-repo/cookbooks" ]

我遇到了同样的问题,无法 运行

knife node run_list add nodename 'recipe[cron-delvalidate::default]' - cron-delvalidator recipe to the node named: chefnode

我读完才发现是Chefnode,不是chefnode,大写"C"。这解决了我的问题。

回复是:

Chefnode:
  run_list: recipe[cron-delvalidate::default]

您需要在.chef 目录下执行knife 命令。我在 .chef 目录下尝试的更改也遇到了同样的问题,它正在工作。试试 "knife client check" 和 "knife cookbook upload yourcookbook".

在 knife.rb 文件中,将 chef_server_url 与您的组织名称一样表示您需要上传食谱的组织。通常类似于“https://api.chef.io/organizations/orgname”并给出您的食谱目录的路径。