aws/opsworks-cookbooks — pull request #21 by danapplegate (2013-03-26 00:59:43+00:00)
Title: Multiple custom cookbook paths

I'm trying to configure my application using OpsWorks. My cookbooks are contained within my main code repository, in a sub-folder. I also organize my cookbooks into a couple of different directories.

Trying to figure out how to configure this correctly in OpsWorks, I found [this line](https://github.com/aws/opsworks-cookbooks/blob/master/opsworks_custom_cookbooks/recipes/default.rb#L11), which seems to add the `node[:opsworks_custom_cookbooks][:destination]` attribute to the cookbooks path. Trying to take the hint off of the call to Array.flatten, I tried setting the "Custom Chef JSON" form field of my stack to this:

```json
{
"opsworks_custom_cookbooks": {
"destination": [
"/opt/aws/opsworks/current/path/to/custom/cookbook",
"/opt/aws/opsworks/current/path/to/another/cookbook"
]
}
}
```

However, setting this attribute to the path of my cookbooks does not work, as the attribute is used in other recipes to initially clone the cookbook repository, as seen here in the [opsworks_custom_cookbooks::checkout recipe](https://github.com/aws/opsworks-cookbooks/blob/master/opsworks_custom_cookbooks/recipes/checkout.rb#L45).

I thought a good solution might be to include another optional attribute to the recipe, which would allow the user to specify an array of custom, relative paths pointing to their cookbook folders within their cookbook repository.

This would allow a user to specify something like this:

```json
{
"opsworks_custom_cookbooks": {
"cookbook_paths": [
"path/to/custom/cookbook",
"path/to/another/cookbook"
]
}
}
```