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

Latest Configuration Changes - New version release? #375

Closed
matthew-watson1 opened this issue Nov 18, 2016 · 4 comments
Closed

Latest Configuration Changes - New version release? #375

matthew-watson1 opened this issue Nov 18, 2016 · 4 comments

Comments

@matthew-watson1
Copy link

The latest tagged version of the cookbook does not contain the performance parameters (for raft multiplier etc) which are needed for production. Any idea when the new version will be committed?

@richid
Copy link

richid commented Nov 22, 2016

Similarly, there are missing configuration options for things like dogstatsd_* and retry_join_ec2 in ConsulConfig. I realize it's difficult to keep this list updated with the available options upstream so I was wondering if there should be an extra_config parameter. This would just be a free-form hash that gets turned into the configuration JSON without any validation.

@johnbellone
Copy link
Contributor

We will be releasing 2.3 in the next few days. PR are welcome for config options that are missing!

@richid
Copy link

richid commented Dec 5, 2016

After reading the Consul documentation some more I found a quick way around this so I'll leave it here in hopes that it helps someone else.

From the Consul docs:

When loading configuration, Consul loads the configuration from files and directories in lexical order. For example, configuration file basic_config.json will be processed before extra_config.json. Configuration specified later will be merged into configuration specified earlier. In most cases, "merge" means that the later version will override the earlier.

So in my wrapper cookbook I just defined some extra attributes:

default['consul']['extra_config']['retry_join_ec2']['region'] = 'us-west-2'
default['consul']['extra_config']['retry_join_ec2']['tag_key'] = 'opsworks:instance'
default['consul']['extra_config']['retry_join_ec2']['tag_value'] = 'consul-*'

And then tossed this into the wrapper cookbook's default recipe:

file "#{node['consul']['service']['config_dir']}/extra_config.json" do
  content JSON.pretty_generate(node['consul']['extra_config'], quirks_mode: true)
  mode '0640'
  owner node['consul']['config']['owner']
  group node['consul']['config']['group']
  notifies :reload, "consul_service[#{node['consul']['service_name']}]", :delayed
end

Works like a charm! Thanks again!

@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

3 participants