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

How to pass extra options since refactor? #209

Closed
scalp42 opened this issue Aug 24, 2015 · 4 comments
Closed

How to pass extra options since refactor? #209

scalp42 opened this issue Aug 24, 2015 · 4 comments

Comments

@scalp42
Copy link
Contributor

scalp42 commented Aug 24, 2015

Hi @johnbellone

Any clues on how to pass extra options for the agent?

I'm looking at retry_join for example, but not sure how to pass it in a wrapper cookbook, as the resource does not have it (https://github.com/johnbellone/consul-cookbook/blob/master/libraries/consul_config.rb#L69).

Another example is the typo recurser in cookbook vs recursor in the config resource. How can I correctly pass recursor instead of recurser ?

Would allowing a hash config make more sense instead of duplicating the agent config in the resource?

Thanks in advance

@scalp42
Copy link
Contributor Author

scalp42 commented Aug 24, 2015

I'm ending up with something like this:

file node['wrapper']['config_path'] do
  owner node['consul']['service_user']
  group node['consul']['service_group']
  mode '644'
  content lazy { JSON.pretty_generate(node['wrapper']['config_settings'], quirks_mode: true) }
end

consul_service node['consul']['service_name'] do |r|
  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) }
  subscribes :restart, %|file[#{node['wrapper']['config_path']}|, :delayed
  action [:enable, :start]
end

@johnbellone
Copy link
Contributor

I have a quick solution to this in the short term, but we should fix the bugs in the configuration. If there are any additional options added we should check against those. I'll have a change up in a little bit.

@scalp42
Copy link
Contributor Author

scalp42 commented Aug 24, 2015

One of the other workaround is to also drop a JSON in config-dir as it'll be merged with the config-file passed:

exec /usr/bin/env consul agent -config-file=/etc/consul.json -config-dir=/etc/consul

The later -config-dir=/etc/consul will override the defaults from the resource.

@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

2 participants