首页 > 解决方案 > 当我尝试运行 chef-solo 时无法找到配置文件

问题描述

当我在我的服务器上运行 ChefSolo 时,它抛出了这个错误,说它找不到我的配置文件(solo.rb 和节点文件),即使它实际上在我的 Chef 目录下。

chef-solo -c solo.rb -j ".\nodes\test.json"
[2019-06-24T07:04:56+00:00] DEBUG: Reading products and relationships...
[2019-06-24T07:04:56+00:00] DEBUG: Successfully read products and relationships
[2019-06-24T07:04:56+00:00] DEBUG: Searching for the following licenses: ["infra-client", "inspec"]
[2019-06-24T07:04:56+00:00] DEBUG: Found license chef_infra_client at C:/Users/simon.lam/.chef/accepted_licenses/chef_in
fra_client
[2019-06-24T07:04:56+00:00] DEBUG: Found license inspec at C:/Users/simon.lam/.chef/accepted_licenses/inspec
[2019-06-24T07:04:56+00:00] DEBUG: Missing licenses remaining: []
[2019-06-24T07:04:56+00:00] DEBUG: All licenses present
[2019-06-24T07:04:56+00:00] FATAL: Cannot load configuration from .\nodes\local.json

PS C:\git\chef> chef -v
Chef Development Kit Version: 4.0.60
chef-client version: 15.0.300
delivery version: master (9d07501a3b347cc687c902319d23dc32dd5fa621)
berks version: 7.0.8
kitchen version: 2.2.5
inspec version: 4.3.2

当我指定 solo.rb 和节点配置文件的完整路径时,它停止抱怨

我尝试安装 Chef WorkStation,但仍然失败并出现同样的错误,找不到 solo.rb。只是想知道我是否错过了任何配置来重新指向厨师以查看我自己的 git chef 目录(C:\git\chef...我所有的厨师食谱、节点和 solo.rb 都在这里)。但是 chef-solo 一直在 C:\solo.rb 中寻找 solo.rb,不知道为什么会这样(可能相对路径不起作用 - 潜在的错误)。

谢谢

标签: rubychef-infrachef-solo

解决方案


推荐阅读