diff --git a/README.md b/README.md index 04914ef2..42aa2493 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,15 @@ Installs and configures [Consul][1]. nil + + ['consul']['extra_params'] + hash + + Pass a hash of extra params to the default.json config file + + {} + + ### Consul UI Attributes diff --git a/attributes/default.rb b/attributes/default.rb index 3e38f3cf..c3619c11 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -70,3 +70,4 @@ default['consul']['client_addr'] = '0.0.0.0' default['consul']['ui_dir'] = '/var/lib/consul/ui' default['consul']['serve_ui'] = false +default['consul']['extra_params'] = {} diff --git a/recipes/_service.rb b/recipes/_service.rb index cc7a00aa..8c411eab 100644 --- a/recipes/_service.rb +++ b/recipes/_service.rb @@ -63,7 +63,7 @@ end # Determine service params -service_config = {} +service_config = JSON.parse(node['consul']['extra_params'].to_json) service_config['data_dir'] = node['consul']['data_dir'] num_cluster = node['consul']['bootstrap_expect'].to_i