File: rabbitmq.config.erb

package info (click to toggle)
puppet-module-puppetlabs-rabbitmq 8.5.0-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,192 kB
  • sloc: ruby: 5,227; sh: 10; makefile: 4
file content (185 lines) | stat: -rw-r--r-- 6,857 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
% This file managed by Puppet
% Template Path: <%= @module_name %>/templates/rabbitmq.config
[
<%- if @ssl and @ssl_versions -%>
  {ssl, [{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}]},
<%- end -%>
  {rabbit, [
<%- if @heartbeat -%>
    {heartbeat, <%=@heartbeat%>},
<% end -%>
    {loopback_users, [<%= @loopback_users.map { |u| "<<\"#{u}\">>" }.join(', ') %>]},
<% 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 %>}},
    {rabbit, [{disk_nodes, [<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>]}]},
    {cluster_partition_handling, <%= @cluster_partition_handling %>},
<% end -%>
    {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 -%>
    {tcp_listeners, [{"<%= @interface%>", <%= @port %>}]},
<%- end -%>
<%- if @ssl -%>
  <%- if @ssl_interface -%>
    {ssl_listeners, [{"<%= @ssl_interface%>", <%= @ssl_port %>}]},
  <%- else -%>
    {ssl_listeners, [<%= @ssl_port %>]},
  <%- end -%>
    {ssl_options, [
                   <%- 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 -%>
                   ,{versions, [<%= @ssl_versions.sort.map { |v| "'#{v}'" }.join(', ') %>]}
                   <%- end -%>
                   <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
                   ,{ciphers,[
                     <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n                     ") %>
                   ]}
                   <%- end -%>
                  ]},
<%- end -%>
<% 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 %>">>},
    {default_pass, <<"<%= @default_pass %>">>}
  ]}<% if @config_kernel_variables -%>,
  {kernel, [
    <%= @config_kernel_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n    ") %>
  ]}
<%- end -%>
<%- 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 && @management_ssl -%>
  <%- if @management_ip_address -%>
      {ip, "<%= @management_ip_address %>"},
  <%- end -%>
      {port, <%= @ssl_management_port %>},
      {ssl, true},
      {ssl_opts, [<%- if @ssl_cacert %>
                  {cacertfile, "<%= @ssl_cacert %>"},
                  <%- end -%>
                  {certfile, "<%= @ssl_cert %>"},
                  {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 -%>
                  <%- if @ssl_ciphers and @ssl_ciphers.size > 0 -%>
                  ,{ciphers,[
                      <%= @ssl_ciphers.sort.map{|k| "{#{k}}"}.join(",\n                      ") %>
                  ]}
                  <%- 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 %>]}
  <%- end -%>
  <%- if @ssl && @ssl_stomp_port -%>
    ,
    {ssl_listeners, [<%= @ssl_stomp_port %>]}
  <%- end -%>
  ]}
<% end -%>
<%- if @ldap_auth -%>,
% Configure the LDAP authentication plugin
  {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 -%>
<%- @ldap_config_variables.keys.sort.each do |key| -%>
    {<%= key %>, <%= @ldap_config_variables[key] %>},
<%- end -%>
<%- end -%>
    {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