I have a cookbook that needs to install software for both Windows and RHEL boxes. There is an existing cookbook I can leverage for the RHEL boxes, which I'll call linux-foo
. I include it in the default recipe with include_recipe 'linux-foo'
and add with depends 'linux-foo'
in the cookbook metadata.
However, by adding the dependency to metadata it's breaking my custom Windows recipe. I'm getting
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Platform:
---------
x64-mingw32
when attempting to converge the windows recipe in test-kitchen. It's referring to the .../linux-foo/attributes/default.rb
as the culprit, but doesn't specify which attribute.
Is there a way to still include_recipe 'linux-foo'
but not include it as a hard dependency in metadata.rb
OR wrap the 3rd party cookbook's default attributes somehow?
It looks like I either keep the dependency and break the windows recipe or separate the linux and windows recipes into separate cookbooks.