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 · 3 comments

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

johnbellone commented Aug 24, 2015

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

This comment has been minimized.

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.

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.