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

Closed
epcim opened this issue Feb 11, 2016 · 2 comments
Closed

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

epcim opened this issue Feb 11, 2016 · 2 comments

Comments

@epcim
Copy link

epcim 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']
end

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>
end
@epcim
Copy link
Author

epcim 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 as completed Feb 11, 2016
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant