Making a Custom Resource more reusable

The Custom Resource we just created, "mywebapp_website", is easily reusable within our mywebapp cookbook and could be used with other cookbooks, but what if we want to expand on its reusability? What if we want to make a cookbook that only has a Custom Resource that we want to use in several cookbooks? The answer is pretty simple. Let's walk through the steps to convert our "website" Custom Resource into a more reusable Custom Resource-only cookbook.

Making a Custom Resource-only cookbook

The Custom Resource website.rb file in the cookbook mywebapp, which we created in the previous section, is almost all we need to create our more reusable Custom Resource-only cookbook. Let's create a new cookbook named appsite ...

Get Chef: Powerful Infrastructure Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.