chef/cookbooks/rabbitmq/templates/default/rabbitmq.config.erb
[
{mnesia,
[
{dump_log_write_threshold, <%= node[:rabbitmq][:mnesia][:dump_log_write_threshold] %>},
{dump_log_time_threshold, <%= node[:rabbitmq][:mnesia][:dump_log_time_threshold] %>}
]
},
{rabbit,
[
<% if node[:rabbitmq][:collect_statistics_interval] -%>
{collect_statistics_interval, <%= node[:rabbitmq][:collect_statistics_interval] %>},
<% end -%>
{tcp_listen_options, [
<%= node[:rabbitmq][:tcp_listen_options].reject { |k,v| v.nil? }.map { |k,v| "{#{k}, #{v}}" }.join(",") %>
]
},
{tcp_listeners, [
<%= @addresses.map { |address| "{\"#{address}\", #{node[:rabbitmq][:port]}}" }.join(", ") %>
]},
<% if node[:rabbitmq][:ssl][:enabled] -%>
{ssl_listeners, [
<%= @addresses.map { |address| "{\"#{address}\", #{node[:rabbitmq][:ssl][:port]}}" }.join(", ") %>
]},
{ssl_options, [
<% if node[:rabbitmq][:ssl][:cert_required] -%>
{cacertfile, "<%= node[:rabbitmq][:ssl][:ca_certs] %>"},
{verify, verify_peer},
{fail_if_no_peer_cert, true},
<% else -%>
{verify, verify_none},
{fail_if_no_peer_cert, false},
<% end -%>
{certfile, "<%= node[:rabbitmq][:ssl][:certfile] %>"},
{keyfile, "<%= node[:rabbitmq][:ssl][:keyfile] %>"}]},
<% end -%>
<% if @cluster_enabled -%>
{cluster_partition_handling, <%= @cluster_partition_handling %>},
{queue_master_locator, <<"min-masters">>},
<% end -%>
<% if @hipe_compile -%>
{hipe_compile, true},
<% end -%>
{disk_free_limit, 50000000}
]},
{rabbitmq_management,
[
{listener, [{ip, "<%= @management_address %>"}, {port, <%= node[:rabbitmq][:management_port] %>}]},
{load_definitions, "/etc/rabbitmq/definitions.json"}
]
}
].