Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow for a hash or string when configuring tags #296
A pattern we're employing with our wrapper cookbooks is to compose the datadog tags attribute so they're rendered out properly in the datadog template. The way it currently is now, the template is rendered at compile time which prevents wrapper cookbooks from modifying the tags during run time. By extracting the attribute to a template variable, we delay the rendering of the template variable until the run phase.
With this patch you will be able to do the following in a recipe:
node.default['datadog']['tags'] = node['datadog']['tags'].merge('region' => 'us-east')
What this does is composes the current set of tags defined in the attribute with an additional tag by way of merging in a new key and value into the hash. You can still provide a string instead which is the currently shipped default so these changes are fully backward compatible.