简体   繁体   English

厨师刀配置

[英]Chef knife configuration

I feel silly asking this question as it seems to work flawlessly for most people but I couldn't solve the following problem I encountered after setting up a Chef server 12 on RHEL 6 and the ChefDK 0.6.0 on my mac. 我觉得这个问题很愚蠢,因为它似乎对大多数人来说都是完美无缺的,但是我无法解决在RHEL 6上设置Chef服务器12和在Mac上设置ChefDK 0.6.0之后遇到的以下问题。

The chef server setup went through like charm as describeb on the documentation, no errors at all. Chef服务器的安装过程像文档中描述的一样经历了魅力,一点都没有错误。 When I wanted to use my machine as workstation to push cookbooks to the server I always get the error "The object you are looking for could not be found". 当我想将机器用作工作站来将菜谱推送到服务器时,总是出现错误“找不到您要查找的对象”。 According to other stackoverlfow posts ( 0 , 1 , 2 ) this is likely due to a configuration issue in knife.rb. 根据其他stackoverlfow帖( 012 )这可能是由于在一个knife.rb配置问题。 Nevertheless, I used "knife configure" to setup the knife.rb file and double checked for any typos in the path. 尽管如此,我还是使用“刀配置”来设置knife.rb文件,并仔细检查了路径中是否有错字。 In addition, according to the knife.rb documentation page I used the attributes properly. 另外,根据knife.rb文档页面,我正确使用了属性。

Anyone have an idea what could cause the problem? 任何人都知道什么可能导致问题?

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" ]

You need to do perform knife commands under .chef directory. 您需要在.chef目录下执行美工刀命令。 I too had same problem for change I tried under .chef directory, it was working. 我在.chef目录下尝试更改时也遇到了同样的问题,它正在工作。 Try "knife client check" and "knife cookbook upload yourcookbook". 尝试“检查刀客户端”和“刀食谱上传yourcookbook”。

In knife.rb file, give chef_server_url as with your orgs name means which org you need to upload the cookbook. 在knife.rb文件中,将chef_server_url设置为您的组织名称,表示您需要上传食谱的组织。 Typically be like " https://api.chef.io/organizations/orgname " and give path to your cookbooks directory. 通常类似于“ https://api.chef.io/organizations/orgname ”,并提供菜谱目录的路径。

I had this same issue, could not run 我有同样的问题,无法运行

knife node run_list add nodename 'recipe[cron-delvalidate::default]' - cron-delvalidator recipe to the node named: chefnode 刀节点run_list添加节点名'recipe [cron-delvalidate :: default]'-cron-delvalidator配方到名为以下节点的节点:

I found out, after reading this that it's Chefnode , not chefnode , capital "C". 读完这篇文章后,我发现它是Chefnode ,而不是大写的“ C” chefnode This solved my issue. 这解决了我的问题。

The response was: 响应是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM