Reputation: 65034
Let's say I want to lay out an attributes directory like so
cookbooks
|- ...
attributes
|- project-one
|--- foo.rb
|--- blah.rb
|--- bar.rb
|- project-two
|--- bang.rb
Is there a way to get chef to find the attributes from the subdirectories listed here? I have a lot of attributes :(
Upvotes: 1
Views: 1153
Reputation: 26997
Unfortunately sub directories is not currently supported (for attributes, libraries, recipes, etc). This item is on the roadmap for Chef 12.
Even if you do some crazy Ruby magic, like doing a dir-glob and require relative, those files in subdirectories won't be uploaded to the Chef Server.
If you find the need for that many attribute files, I would suggest re-examining the domain scope for your cookbook. In general, a cookbook should manage a single application or service. If you find yourself having many different features and cases, you may want to try breaking it into smaller cookbooks. I'd be happy to take a look and provide some guidance.
Upvotes: 3