0

Issue: I was trying to use chef_zero to test my cookbook roles specified in ruby DSL format, but when I tried to do kitchen converge. It looks like it's not able to expand the role specified in kitchen.yml.

How to Resolve: Is it not possible to use chef-zero to test roles in a cookbook using test-kitchen or am I not calling the role correctly in my kitchen.yml. how do I test roles using chef_zero locally.

**chef-environment**:

Chef Development Kit Version: 0.12.0
chef-client version: 12.8.1
berks version: 4.3.0
kitchen version: 1.6.0

**kitchen.yml**:

suites:
  - name: default
    run_list:
      - role[test_role]

 **Error**

 [2016-05-25T12:58:37-04:00] ERROR: Role test_role (included by 'top level') is in the runlist but does not exist. Skipping expand.

   ================================================================================
   Error expanding the run_list:
   ================================================================================

   Missing Role(s) in Run List:
   ----------------------------
   * test_role included by 'top level'

   Original Run List
   -----------------
   * role[test_role]

chef-stacktrace.out:

Chef::Exceptions::MissingRole: The expanded run list includes nonexistent roles: test_role

bablu
  • 75
  • 4
  • 11

1 Answers1

0

ChefFS (and thus zero, local mode, solo, etc) didn't support Ruby-formatted files until 12.10 (the most recent release). You'll need to use the JSON format for older Chef.

coderanger
  • 52,400
  • 4
  • 52
  • 75