我们可以在kitchen.yml中添加角色吗? [英] Can we add a role in kitchen.yml?

查看:58
本文介绍了我们可以在kitchen.yml中添加角色吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的厨房.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:

而且我不断收到以下错误

and I keep getting the following error

    [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的运行列表属性中使用角色?

role is definitely there on chef server but still I am getting this error. Are we not allowed to use role in kitchen.yml's run list attribute?

推荐答案

如注释中所述,角色的文件名必须匹配其 name 字段,并且必须匹配 role [名称] 字符串在运行列表中.确保所有这三个对齐,并且您都应该准备就绪.

As mentioned in the comments, the filename of the role must match its name field and that must match the role[name] string in the run list. Make sure all three of those align and you should be all set.

这篇关于我们可以在kitchen.yml中添加角色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆