刀不使用Knife.rb.

时间:2018-05-24 19:09:25

标签: chef knife

Chef:14.1.12 Windows 10 阅读教程here我的~rrow-chef / .chef / knife.rb(C:\ users \ wdavis \ learn-chef.chef \ knife.rb)中有我的knife.rb

我运行ssl fetch knife ssl fetch

Results:
    INFO: Using configuration from C:/Users/wdavis/learn-chef/.chef/knife.rb
    WARNING: Certificates from localhost will be fetched and placed in your trusted_cert
    directory (c:\users\wdavis\learn-chef\.chef\trusted_certs).

    Knife has no means to verify these are the correct certificates. You should
    verify the authenticity of these certificates after downloading.

    ERROR: Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. - SSL_connect

这是我的knife.rb:

current_dir = File.dirname(__FILE__)
log_level                 :info
log_location              STDOUT
node_name                 "chefadmin"
client_key                "#{current_dir}/chefadmin.pem"
chef_server_url           "https://synchef.url.com/organizations/syn"
cookbook_path             ["#{current_dir}/../cookbooks/"]

但是,如果我跑: knife ssl fetch https://synchef.url.com

它工作正常 - 那么为什么只使用knife.rb它不起作用?

我还应该补充一点,我在尝试上传食谱时遇到了类似的问题。它说它使用我的knife.rb和烹饪书显然在那里,但它声称它找不到它们。

所以在我看来也许它真的没有使用knife.rb应该吗?

这是另一个例子:

knife ssl check -V
INFO: Using configuration from C:/Users/wdavis/learn-chef/.chef/knife.rb
Connecting to host localhost:443
ERROR: Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. - SSL_connect

为什么要尝试连接到localhost:443?这不是我的knife.rb配置的内容

1 个答案:

答案 0 :(得分:1)

我在VS Code中编写了原始文件 - 将文件保存为UTF-16 LE。我注意到在我下载的入门工具包中的文件是UTF-8。我用UTF-8重新保存了我的文件,命令工作正常。看来ChefDk附带的ruby版本不喜欢UTF-16LE?