X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Ftemplates%2Frabbitmq.config.erb;h=791c919b88818fea6db0490b7a8bff9450fa9adc;hb=94a8783f522bbf2996cb8a59b977dea583e8b0c7;hp=4e2154e5558f8731ade1c510c23cd050da25d8da;hpb=e107504bce7d9b21cc301124fc7c39fdb0762374;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/templates/rabbitmq.config.erb b/3rdparty/modules/rabbitmq/templates/rabbitmq.config.erb index 4e2154e55..791c919b8 100644 --- a/3rdparty/modules/rabbitmq/templates/rabbitmq.config.erb +++ b/3rdparty/modules/rabbitmq/templates/rabbitmq.config.erb @@ -5,33 +5,72 @@ {ssl, [{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}]}, <%- end -%> {rabbit, [ -<% if @ldap_auth -%> +<%- if @heartbeat -%> + {heartbeat, <%=@heartbeat%>}, +<% end -%> +<% if @auth_backends -%> + {auth_backends, [<%= @auth_backends.map { |v| "#{v}" }.join(', ') %>]}, +<% elsif @ldap_auth -%> {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]}, <% end -%> <% if @config_cluster -%> {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}]}, + {tcp_listen_options, [ + <%- unless @config_ranch -%> + binary, + {packet, raw}, + {reuseaddr, true}, + <%- end -%> + <%- if @tcp_keepalive -%> + {keepalive, true}, + <%- end -%> + <%- if @tcp_backlog -%> + {backlog, <%= @tcp_backlog %>}, + <%- end -%> + <%- if @tcp_sndbuf -%> + {sndbuf, <%= @tcp_sndbuf %>}, + <%- end -%> + <%- if @tcp_recbuf -%> + {recbuf, <%= @tcp_recbuf %>}, + <%- end -%> + {nodelay, true}, + {linger, {true, 0}}, + {exit_on_close, false} + ]}, +<%- if @collect_statistics_interval -%> + {collect_statistics_interval, <%= @collect_statistics_interval %>}, <%- end -%> <%- if @ssl_only -%> {tcp_listeners, []}, -<%- elsif @interface != 'UNSET' -%> +<%- elsif @interface -%> {tcp_listeners, [{"<%= @interface%>", <%= @port %>}]}, <%- end -%> <%- if @ssl -%> - <%- if @ssl_interface != 'UNSET' -%> + <%- if @ssl_interface -%> {ssl_listeners, [{"<%= @ssl_interface%>", <%= @ssl_port %>}]}, <%- else -%> {ssl_listeners, [<%= @ssl_port %>]}, <%- end -%> {ssl_options, [ - <%- if @ssl_cacert != 'UNSET' -%> + <%- if @ssl_cacert -%> {cacertfile,"<%= @ssl_cacert %>"}, <%- end -%> {certfile,"<%= @ssl_cert %>"}, {keyfile,"<%= @ssl_key %>"}, + <%- if @ssl_cert_password -%> + {password, "<%= @ssl_cert_password %>"}, + <%- end -%> + <%- if @ssl_depth -%> + {depth,<%= @ssl_depth %>}, + <%- end -%> + <%- if @ssl_dhfile -%> + {dhfile, "<%= @ssl_dhfile %>"}, + <%- end -%> + {secure_renegotiate,<%= @ssl_secure_renegotiate %>}, + {reuse_sessions,<%= @ssl_reuse_sessions %>}, + {honor_cipher_order,<%= @ssl_honor_cipher_order %>}, {verify,<%= @ssl_verify %>}, {fail_if_no_peer_cert,<%= @ssl_fail_if_no_peer_cert %>} <%- if @ssl_versions -%> @@ -44,9 +83,9 @@ <%- end -%> ]}, <%- end -%> -<% if @config_variables -%> -<%- @config_variables.keys.sort.each do |key| -%> - {<%= key %>, <%= @config_variables[key] %>}, +<% if scope['rabbitmq::config_variables'] -%> +<%- scope['rabbitmq::config_variables'].keys.sort.each do |key| -%> + {<%= key %>, <%= scope['rabbitmq::config_variables'][key] %>}, <%- end -%> <%- end -%> {default_user, <<"<%= @default_user %>">>}, @@ -56,16 +95,27 @@ <%= @config_kernel_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n ") %> ]} <%- end -%> -<%- if @admin_enable -%>, +<%- if @admin_enable or !@config_management_variables.empty? -%>, {rabbitmq_management, [ + <%- if !@config_management_variables.empty? -%> + <%= @config_management_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n ") %> + <%- end -%> +<%- if @admin_enable -%> +<%- if !@config_management_variables.empty? -%>,<%-end-%> {listener, [ -<%- if @ssl -%> +<%- if @ssl && @management_ssl -%> + <%- if @management_ip_address -%> + {ip, "<%= @management_ip_address %>"}, + <%- end -%> {port, <%= @ssl_management_port %>}, {ssl, true}, - {ssl_opts, [<%- if @ssl_cacert != 'UNSET' -%>{cacertfile, "<%= @ssl_cacert %>"},<%- end -%> - + {ssl_opts, [<%- if @ssl_cacert %> + {cacertfile, "<%= @ssl_cacert %>"}, + <%- end -%> {certfile, "<%= @ssl_cert %>"}, - {keyfile, "<%= @ssl_key %>"} + {keyfile, "<%= @ssl_key %>"}, + {verify,<%= @ssl_management_verify %>}, + {fail_if_no_peer_cert,<%= @ssl_management_fail_if_no_peer_cert %>} <%- if @ssl_versions -%> ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]} <%- end -%> @@ -76,16 +126,25 @@ <%- end -%> ]} <%- else -%> + <%- if @management_ip_address -%> + {ip, "<%= @management_ip_address %>"}, + <%- end -%> {port, <%= @management_port %>} <%- end -%> ]} +<%- end -%> ]} <%- end -%> <% if @config_stomp -%>, % Configure the Stomp Plugin listening port {rabbitmq_stomp, [ + <%- if @stomp_ssl_only -%> + {tcp_listeners, []} + <%- else -%> {tcp_listeners, [<%= @stomp_port %>]} - <%- if @ssl && @ssl_stomp_port -%>, + <%- end -%> + <%- if @ssl && @ssl_stomp_port -%> + , {ssl_listeners, [<%= @ssl_stomp_port %>]} <%- end -%> ]} @@ -95,7 +154,9 @@ {rabbitmq_auth_backend_ldap, [ {other_bind, <%= @ldap_other_bind %>}, {servers, ["<%= @ldap_server %>"]}, +<% if @ldap_user_dn_pattern -%> {user_dn_pattern, "<%= @ldap_user_dn_pattern %>"}, +<%- end -%> {use_ssl, <%= @ldap_use_ssl %>}, {port, <%= @ldap_port %>}, <% if @ldap_config_variables -%> @@ -106,5 +167,17 @@ {log, <%= @ldap_log %>} ]} <%- end -%> +<%- if @config_shovel and not @config_shovel_statics.empty? -%>, + {rabbitmq_shovel, + [{shovels,[ + <%= @config_shovel_statics.sort.map{|k,v| "{#{k},[#{v}]}"}.join(",\n ") %> + ]}]} +<%- end -%> +<%- if @config_additional_variables and not @config_additional_variables.empty? -%>, +% Additional config +<%- @config_additional_variables.keys.sort.each do |key| -%> + {<%= key %>, <%= @config_additional_variables[key] %>}<%- if key != @config_additional_variables.keys.sort.last %>,<% end %> +<%- end -%> +<%- end -%> ]. % EOF