【问题标题】:unable to upload cookbook using knife command无法使用刀命令上传食谱
【发布时间】:2016-02-17 12:08:55
【问题描述】:

在 Windows 中,无法将食谱上传到托管厨师服务器。我的 Knife.rd 文件:

# See http://docs.chef.io/config_rb_knife.html for more information on knife configuration options
current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "xxxxx"
client_key               "#{current_dir}/xxxxx.pem"
validation_client_name   "wis-validator"
validation_key           "#{current_dir}/wis-validator.pem"
chef_server_url          "https://api.chef.io/organizations/xxxx"
cookbook_path            ["#{current_dir}/../cookbooks/"]

当我运行knife upload learn_chef_apache2 命令时,出现以下错误消息

错误:当前时尝试使用相对路径“learn_chef_apache2” 目录位于存储库路径之外。错误:当前工作 目录是'E:/Prasanna_POC/learn_chef'。

我正在从食谱文件夹所在的路径和 learn_chef_apache2 食谱所在的路径中运行刀上传命令

【问题讨论】:

  • 你的 .chef 目录在哪里?

标签: chef-infra knife cookbook


【解决方案1】:

我认为你的意思是运行knife cookbook upload learn_chef_apache2knife upload 命令比较通用,可以上传很多类型的东西,但是你需要给它对象的路径。

【讨论】:

    【解决方案2】:

    当你运行命令:knife upload learn_chef_apache2 时,你必须确保你的 cookbook_path 中有说明书 learn_chef_apache2

    cookbook_path 设置在您的knife.rb 文件中。

    cookbook_path            ["#{current_dir}/../cookbooks/"]
    

    请确保这是:knife.rb 而不是 Knife.rd

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多