]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/rabbitmq/templates/rabbitmq.config.erb
move to puppetlabs rabbitmq module
[dsa-puppet.git] / 3rdparty / modules / rabbitmq / templates / rabbitmq.config.erb
1 % This file managed by Puppet
2 % Template Path: <%= @module_name %>/templates/rabbitmq.config
3 [
4 <%- if @ssl and @ssl_versions -%>
5   {ssl, [{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}]},
6 <%- end -%>
7   {rabbit, [
8 <% if @ldap_auth -%>
9     {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},
10 <% end -%>
11 <% if @config_cluster -%>
12     {cluster_nodes, {[<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}},
13     {cluster_partition_handling, <%= @cluster_partition_handling %>},
14 <% end -%>
15 <%- if @tcp_keepalive -%>
16     {tcp_listen_options, [{keepalive, true}]},
17 <%- end -%>
18 <%- if @ssl_only -%>
19     {tcp_listeners, []},
20 <%- elsif @interface != 'UNSET' -%>
21     {tcp_listeners, [{"<%= @interface%>", <%= @port %>}]},
22 <%- end -%>
23 <%- if @ssl -%>
24   <%- if @ssl_interface != 'UNSET' -%>
25     {ssl_listeners, [{"<%= @ssl_interface%>", <%= @ssl_port %>}]},
26   <%- else -%>
27     {ssl_listeners, [<%= @ssl_port %>]},
28   <%- end -%>
29     {ssl_options, [
30                    <%- if @ssl_cacert != 'UNSET' -%>
31                    {cacertfile,"<%= @ssl_cacert %>"},
32                    <%- end -%>
33                    {certfile,"<%= @ssl_cert %>"},
34                    {keyfile,"<%= @ssl_key %>"},
35                    {verify,<%= @ssl_verify %>},
36                    {fail_if_no_peer_cert,<%= @ssl_fail_if_no_peer_cert %>}
37                    <%- if @ssl_versions -%>
38                    ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}
39                    <%- end -%>
40                    <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
41                    ,{ciphers,[
42                      <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n                     ") %>
43                    ]}
44                    <%- end -%>
45                   ]},
46 <%- end -%>
47 <% if @config_variables -%>
48 <%- @config_variables.keys.sort.each do |key| -%>
49     {<%= key %>, <%= @config_variables[key] %>},
50 <%- end -%>
51 <%- end -%>
52     {default_user, <<"<%= @default_user %>">>},
53     {default_pass, <<"<%= @default_pass %>">>}
54   ]}<% if @config_kernel_variables -%>,
55   {kernel, [
56     <%= @config_kernel_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n    ") %>
57   ]}
58 <%- end -%>
59 <%- if @admin_enable -%>,
60   {rabbitmq_management, [
61     {listener, [
62 <%- if @ssl -%>
63       {port, <%= @ssl_management_port %>},
64       {ssl, true},
65       {ssl_opts, [<%- if @ssl_cacert != 'UNSET' -%>{cacertfile, "<%= @ssl_cacert %>"},<%- end -%>
66
67                   {certfile, "<%= @ssl_cert %>"},
68                   {keyfile, "<%= @ssl_key %>"}
69                    <%- if @ssl_versions -%>
70                      ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}
71                    <%- end -%>
72                   <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
73                   ,{ciphers,[
74                       <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n                      ") %>
75                   ]}
76                   <%- end -%>
77                  ]}
78 <%- else -%>
79       {port, <%= @management_port %>}
80 <%- end -%>
81     ]}
82   ]}
83 <%- end -%>
84 <% if @config_stomp -%>,
85 % Configure the Stomp Plugin listening port
86   {rabbitmq_stomp, [
87     {tcp_listeners, [<%= @stomp_port %>]}
88   <%- if @ssl && @ssl_stomp_port -%>,
89     {ssl_listeners, [<%= @ssl_stomp_port %>]}
90   <%- end -%>
91   ]}
92 <% end -%>
93 <%- if @ldap_auth -%>,
94 % Configure the LDAP authentication plugin
95   {rabbitmq_auth_backend_ldap, [
96     {other_bind, <%= @ldap_other_bind %>},
97     {servers, ["<%= @ldap_server %>"]},
98     {user_dn_pattern, "<%= @ldap_user_dn_pattern %>"},
99     {use_ssl, <%= @ldap_use_ssl %>},
100     {port, <%= @ldap_port %>},
101 <% if @ldap_config_variables -%>
102 <%- @ldap_config_variables.keys.sort.each do |key| -%>
103     {<%= key %>, <%= @ldap_config_variables[key] %>},
104 <%- end -%>
105 <%- end -%>
106     {log, <%= @ldap_log %>}
107   ]}
108 <%- end -%>
109 ].
110 % EOF