bloomberg / consul-cluster-cookbook

Wrapper cookbook which installs and configures a Consul cluster.
Other
26 stars 20 forks source link

About override data bag item #4

Open sshah-biz opened 7 years ago

sshah-biz commented 7 years ago

How can override the data bag item for sanely override the data bag item name in our wrapper cookbook. We keep following items in data bag and will like to know what are the changes required to use this by overriding data bag items. ['consul-cluster']['tls']['ssl_key']['item'] ['consul-cluster']['tls']['ssl_cert']['item'] ['consul-cluster']['tls']['ssl_chain']['item']

Your quick help will be appreciated.

Thank you, Sanjay

jasmeralia commented 7 years ago

To add on to this for clarity, we have different data bag items for different environments (using different encryption keys) and programmatically determine which item to use based on the environment using a cookbook (so moxie-inventory cookbook generates a node['moxie']['dc_and_mode'] which would be like 'bel_dev', 'pdx_prod', 'aws_poc', etc.).

We've tried setting the attributes through lazy { node['moxie']['dc_and_mode'] }, but that errored on the lazy evaluator. We tried adding it into the recipe before we call this cookbook, but that errored out because it thought the value was nil.