【发布时间】:2017-09-21 00:24:57
【问题描述】:
这是我的厨房.yml
---
driver:
name: vagrant
network:
- ["private_network", {ip: "192.168.35.35"}]
provisioner:
name: chef_zero
# You may wish to disable always updating cookbooks in CI or other testing environments.
# For example:
# always_update_cookbooks: <%= !ENV['CI'] %>
always_update_cookbooks: true
roles_path: test/integration/roles/
verifier:
name: inspec
platforms:
- name: ubuntu-14.04
suites:
- name: default
run_list:
- role[tomcat_role]
verifier:
inspec_tests:
- test/smoke/default
attributes:
我不断收到以下错误
[2017-04-24T10:39:02+00:00] ERROR: Role tomcat_role (included by 'top lev
el') is in the runlist but does not exist. Skipping expand.
=========================================================================
=======
Error expanding the run_list:
=========================================================================
=======
Missing Role(s) in Run List:
----------------------------
* tomcat_role included by 'top level'
角色肯定存在于厨师服务器上,但我仍然收到此错误。是不是不能在kitchen.yml的run list属性中使用role?
【问题讨论】:
-
Chef Server 无关紧要,因为您使用的是本地配置器,但是您将测试角色放在什么路径中?
-
json 文件 (tomcat.json) 位于 test/integration/roles 文件夹
roles_path: test/integration/roles/更新帖子。 -
我应该将我的 json 文件保存在任何特定位置吗?
-
如果你调用角色文件
tomcat.json,那么你不应该在test-kitchen中将它称为tomcat_role。 IIRC 文件名很重要。 -
我试过了。我的 json 文件名是
tomcatrole,json 中的名称字段也是tomcatrole并且在 kitchen.yml 中我也有tomcatrolerun_list: - "role[tomcatrole]"