-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Question: Configuring Consul #229
Comments
@majormoses this is how I go about it: file node['gz-consul']['config_path'] do
owner node['consul']['service_user']
group node['consul']['service_group']
mode '644'
content lazy { JSON.pretty_generate(node['gz-consul']['config'], quirks_mode: true) }
action node['gz-consul']['nuke'] ? :delete : :create
end
consul_service node['consul']['service_name'] do |r|
data_dir node['gz-consul']['config']['data_dir']
user node['consul']['service_user']
group node['consul']['service_group']
version node['consul']['version']
config_file node['gz-consul']['config_path']
node['consul']['service'].each_pair { |k, v| r.send(k, v) }
if node['gz-consul']['nuke'] || node['is_packer']
action [:disable]
else
subscribes :restart, %|file[#{node['gz-consul']['config_path']}|, :delayed unless service_status.any? { |x| [:disable].include?(x) }
action service_status
end
ignore_failure true if node['gz-consul']['nuke']
end Pretty much I generate the JSON myself and pass it to the Hopefully helps! |
@scalp42 thanks let me take a crack at it. |
@scalp42 thanks with a bit of modification that got me what I needed. Still having issues but I will try to see what is going on and open new issues accordingly. |
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. |
From my understanding (I could be very wrong) of having read this cookbooks recipes and resource providers it looks to me like any value that is namespaced under node['consul']['config'](as long as the provider supports it) are passed to the consul_config and consul_service provider:
https://github.com/johnbellone/consul-cookbook/blob/master/recipes/default.rb#L38-L46
I have injected a bunch of config under and it does not seem to be having any affect. Here is the chef attributes I am passing it:
Here is the consul config that is being generated:
The text was updated successfully, but these errors were encountered: