Skip to content

Commit

Permalink
Merge pull request #26 from jubianchi/consul-ports
Browse files Browse the repository at this point in the history
Add attributes to configure Consul ports
  • Loading branch information
johnbellone committed Nov 15, 2014
2 parents 3643ab6 + 0274688 commit 92a11df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
default['consul']['init_style'] = 'init' # 'init', 'runit'
default['consul']['service_user'] = 'consul'
default['consul']['service_group'] = 'consul'
default[:consul][:ports] = {
:dns => 8600,
:http => 8500,
:rpc => 8400,
:serf_lan => 8301,
:serf_wan => 8302,
:server => 8300,
}

# Optionally bind to a specific interface
default['consul']['bind_interface'] = nil
Expand Down
6 changes: 5 additions & 1 deletion recipes/_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@
end

copy_params = [
:bind_addr, :datacenter, :domain, :log_level, :node_name, :advertise_addr, :enable_syslog, :encrypt
:bind_addr, :datacenter, :domain, :log_level, :node_name, :advertise_addr, :ports, :enable_syslog, :encrypt
]
copy_params.each do |key|
if node['consul'][key]
if key == :ports
Chef::Application.fatal! 'node[:consul][:ports] must be a Hash' unless node[:consul][key].kind_of?(Hash)
end

service_config[key] = node['consul'][key]
end
end
Expand Down

0 comments on commit 92a11df

Please sign in to comment.