1

我正在使用 Chef Automate 的工作流部分向我的 Chef 服务器提供食谱。我已经通过管道成功地在 Chef Server 上上传了 2 本食谱。

在 Chef 服务器
apache上:版本 0.2.3
another_test版本 0.1.1

我想更改以apache依赖 another_test,因此我更新了元数据apache并将版本提升到0.2.4.

元数据文件apachedepends 'another_test'another_test没有依赖项。

Berksfileapache

source :chef_server
source 'https://supermarket.chef.io'
metadata

当我拨打交付审查电话时,管道启动,但在验证阶段的单元测试阶段失败。

execute[unit_rspec_apache] action run

==================================================== ==============================
在资源'execute[unit_rspec_apache]'上执行操作'run'时出错====== ==================================================== ========================
Mixlib::ShellOut::ShellCommandFailed
-------------------- -----------------
预期进程以 [0] 退出,但收到 '1'
---- 开始输出 rspec --format 文档 --color ----
STDOUT:[2017-11-21T14:06:57+00:00] 错误:连接拒绝连接到https://localhost/universe,重试 1/5
[2017-11-21T14:07:02+00:00]错误:连接拒绝连接到https://localhost/universe,重试 2/5
[2017-11-21T14:07:07+00:00] 错误:连接拒绝连接到https://localhost/universe,重试 3/5
[2017-11-21T14:07:12+00:00] 错误:连接拒绝连接到https://localhost/universe,重试 4/5
[2017-11-21T14:07:17+00:00] 错误:连接拒绝连接到https://localhost/universe,重试 5/5

`before(:suite)` 挂钩中发生错误。失败/错误:raise NoSolutionError.new(demands, e)

Berkshelf::NoSolutionError: 由于解决方案约束 (apache = 0.2.4),无法满足另一个不存在的包 another_test 的约束。可能导致对 another_test 的约束的解决方案约束:[(apache = 0.2.4) -> (another_test >= 0.0.0)]
缺少工件:another_test
无法满足的需求:(apache = 0.2.4)
无法找到需求解决方案:apache (0.2.4)

由于这个故障,新版本的 apache 0.2.4 永远不会上传到 Chef Server。

编辑:我已经使用超市的依赖项进行了测试,它通过了验证阶段。所以我有depends 'java'apache 并且上传得很好。当我依赖来自我的厨师服务器的食谱时,问题就开始了。

编辑 2:我可以登录跑步者并执行knife cookbook list. 这向我证明了跑步者可以访问厨师服务器并查看那里存在哪些食谱。我也尝试过更改 Berksfileapachesource 'https://<full-url-to-chef-server/organizations/myorg'代替source :chef_server

4

1 回答 1

0

我不得不编辑/var/opt/delivery/workspace/.chef/knife.rb运行器节点上的文件。我在文件底部添加了这一行:chef_server_url 'https://chef-server/organizations/myorg'.

此刀配置文件由运行器节点上的 dbuild 用户使用。它读取此文件以确定厨师服务器的 URL。

于 2017-11-21T21:35:02.240 回答