Chef resources failing with wrong constant name

When trying to add a custom resource, no matter what, I always got a  wrong constant name  error, for example:

It turned out to be an issue with my cookbook name: it’s not allowed to have a cookbook name starting with a number (as later, it’s converted into a class name).

So my cookbooks as below are causing the problems:

They should be renamed into something else, for example:

Note, inside the files, there are references to the names, so you may need to update them accordingly, for example using:

After this, no more strange errors after adding resources.

PS: When you work on MacOS, you may face another problem with your resources: MacOS trash files (._* or .DS_Store) are causing another (similarly looking) error. Take a look at this web page.

 

Chef resources failing with wrong constant name
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *