Skip to content

Commit

Permalink
MODULES-1871 - Added default values to tcp_listen_options
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnytdevops committed Jun 2, 2015
1 parent 067d25e commit e8e3f55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec/classes/rabbitmq_spec.rb
Expand Up @@ -923,14 +923,14 @@
let(:params) {{ :tcp_keepalive => true }}
it 'should set tcp_listen_options keepalive true' do
should contain_file('rabbitmq.config') \
.with_content(/\{tcp_listen_options, \[\{keepalive, true\}\]\},/)
.with_content(/\{keepalive, true\}/)
end
end

describe 'tcp_keepalive disabled (default)' do
it 'should not set tcp_listen_options' do
should contain_file('rabbitmq.config') \
.without_content(/\{tcp_listen_options, \[\{keepalive, true\}\]\},/)
.without_content(/\{keepalive, true\}/)
end
end

Expand Down
14 changes: 11 additions & 3 deletions templates/rabbitmq.config.erb
Expand Up @@ -12,9 +12,17 @@
{cluster_nodes, {[<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}},
{cluster_partition_handling, <%= @cluster_partition_handling %>},
<% end -%>
<%- if @tcp_keepalive -%>
{tcp_listen_options, [{keepalive, true}]},
<%- end -%>
{tcp_listen_options,
[binary,
<%- if @tcp_keepalive -%>
{keepalive, true},
<%- end -%>
{packet, raw},
{reuseaddr, true},
{backlog, 128},
{nodelay, true},
{exit_on_close, false}]
},
<%- if @ssl_only -%>
{tcp_listeners, []},
<%- elsif @interface != 'UNSET' -%>
Expand Down

0 comments on commit e8e3f55

Please sign in to comment.