Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default['consul']['config']['bag_name'] broke consul_config #276

epcim opened this Issue Feb 11, 2016 · 1 comment


None yet
1 participant
Copy link

commented Feb 11, 2016

Well I am not sure whether I got the full understanding of the resources in this cookbook. Well my issue is actually that 2nd run of converge do not re-write consul.json config with (start_join) option populated by chef search.

To fix that, I decide to use consul_config resource and place consul.config attributes to an "option" option. However it fails. See:

default['consul']['config']['bag_name'] = 'secrets'
default['consul']['config']['bag_item'] = 'consul'

as in default attributes, then following code fails, as bag_name is not proper key for consul cfg.

consul_config '/etc/consul/consul.json' do
  options default['consul']['config']

Thanks for any guidance in my problem in advance. I am about to try now:

consul_config '/etc/consul/consul.json' do
  start_join <value from search>

This comment has been minimized.

Copy link

commented Feb 11, 2016

I am sorry. I am taking it back. I found an bug in my recipes that was reseting start_join to [] which caused all the troubles.

Then I fully got the point, we filter the node.consul.config in the cosul_config resource on to_json method. So the proper way to populate it is over procedure used in default recipe:

node['consul']['config'].each_pair { |k, v| r.send(k, v) }

@epcim epcim closed this Feb 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.