1 % This file managed by Puppet
2 % Template Path: <%= @module_name %>/templates/rabbitmq.config
4 <%- if @ssl and @ssl_versions -%>
5 {ssl, [{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}]},
9 {heartbeat, <%=@heartbeat%>},
11 {loopback_users, [<%= @loopback_users.map { |u| "<<\"#{u}\">>" }.join(', ') %>]},
12 <% if @auth_backends -%>
13 {auth_backends, [<%= @auth_backends.map { |v| "#{v}" }.join(', ') %>]},
14 <% elsif @ldap_auth -%>
15 {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},
17 <% if @config_cluster -%>
18 {cluster_nodes, {[<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}},
19 {cluster_partition_handling, <%= @cluster_partition_handling %>},
21 {tcp_listen_options, [
22 <%- unless @config_ranch -%>
27 <%- if @tcp_keepalive -%>
30 <%- if @tcp_backlog -%>
31 {backlog, <%= @tcp_backlog %>},
33 <%- if @tcp_sndbuf -%>
34 {sndbuf, <%= @tcp_sndbuf %>},
36 <%- if @tcp_recbuf -%>
37 {recbuf, <%= @tcp_recbuf %>},
41 {exit_on_close, false}
43 <%- if @collect_statistics_interval -%>
44 {collect_statistics_interval, <%= @collect_statistics_interval %>},
48 <%- elsif @interface -%>
49 {tcp_listeners, [{"<%= @interface%>", <%= @port %>}]},
52 <%- if @ssl_interface -%>
53 {ssl_listeners, [{"<%= @ssl_interface%>", <%= @ssl_port %>}]},
55 {ssl_listeners, [<%= @ssl_port %>]},
58 <%- if @ssl_cacert -%>
59 {cacertfile,"<%= @ssl_cacert %>"},
61 {certfile,"<%= @ssl_cert %>"},
62 {keyfile,"<%= @ssl_key %>"},
63 <%- if @ssl_cert_password -%>
64 {password, "<%= @ssl_cert_password %>"},
67 {depth,<%= @ssl_depth %>},
69 <%- if @ssl_dhfile -%>
70 {dhfile, "<%= @ssl_dhfile %>"},
72 {secure_renegotiate,<%= @ssl_secure_renegotiate %>},
73 {reuse_sessions,<%= @ssl_reuse_sessions %>},
74 {honor_cipher_order,<%= @ssl_honor_cipher_order %>},
75 {verify,<%= @ssl_verify %>},
76 {fail_if_no_peer_cert,<%= @ssl_fail_if_no_peer_cert %>}
77 <%- if @ssl_versions -%>
78 ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}
80 <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
82 <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n ") %>
87 <% if scope['rabbitmq::config_variables'] -%>
88 <%- scope['rabbitmq::config_variables'].keys.sort.each do |key| -%>
89 {<%= key %>, <%= scope['rabbitmq::config_variables'][key] %>},
92 {default_user, <<"<%= @default_user %>">>},
93 {default_pass, <<"<%= @default_pass %>">>}
94 ]}<% if @config_kernel_variables -%>,
96 <%= @config_kernel_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n ") %>
99 <%- if @admin_enable or !@config_management_variables.empty? -%>,
100 {rabbitmq_management, [
101 <%- if !@config_management_variables.empty? -%>
102 <%= @config_management_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n ") %>
104 <%- if @admin_enable -%>
105 <%- if !@config_management_variables.empty? -%>,<%-end-%>
107 <%- if @ssl && @management_ssl -%>
108 <%- if @management_ip_address -%>
109 {ip, "<%= @management_ip_address %>"},
111 {port, <%= @ssl_management_port %>},
113 {ssl_opts, [<%- if @ssl_cacert %>
114 {cacertfile, "<%= @ssl_cacert %>"},
116 {certfile, "<%= @ssl_cert %>"},
117 {keyfile, "<%= @ssl_key %>"},
118 {verify,<%= @ssl_management_verify %>},
119 {fail_if_no_peer_cert,<%= @ssl_management_fail_if_no_peer_cert %>}
120 <%- if @ssl_versions -%>
121 ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}
123 <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
125 <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n ") %>
130 <%- if @management_ip_address -%>
131 {ip, "<%= @management_ip_address %>"},
133 {port, <%= @management_port %>}
139 <% if @config_stomp -%>,
140 % Configure the Stomp Plugin listening port
142 <%- if @stomp_ssl_only -%>
145 {tcp_listeners, [<%= @stomp_port %>]}
147 <%- if @ssl && @ssl_stomp_port -%>
149 {ssl_listeners, [<%= @ssl_stomp_port %>]}
153 <%- if @ldap_auth -%>,
154 % Configure the LDAP authentication plugin
155 {rabbitmq_auth_backend_ldap, [
156 {other_bind, <%= @ldap_other_bind %>},
157 {servers, ["<%= @ldap_server %>"]},
158 <% if @ldap_user_dn_pattern -%>
159 {user_dn_pattern, "<%= @ldap_user_dn_pattern %>"},
161 {use_ssl, <%= @ldap_use_ssl %>},
162 {port, <%= @ldap_port %>},
163 <% if @ldap_config_variables -%>
164 <%- @ldap_config_variables.keys.sort.each do |key| -%>
165 {<%= key %>, <%= @ldap_config_variables[key] %>},
168 {log, <%= @ldap_log %>}
171 <%- if @config_shovel and not @config_shovel_statics.empty? -%>,
174 <%= @config_shovel_statics.sort.map{|k,v| "{#{k},[#{v}]}"}.join(",\n ") %>
177 <%- if @config_additional_variables and not @config_additional_variables.empty? -%>,
179 <%- @config_additional_variables.keys.sort.each do |key| -%>
180 {<%= key %>, <%= @config_additional_variables[key] %>}<%- if key != @config_additional_variables.keys.sort.last %>,<% end %>