-
Notifications
You must be signed in to change notification settings - Fork 423
/
default.rb
299 lines (249 loc) · 12.1 KB
/
default.rb
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# frozen_string_literal: true
# Version to install
default['rabbitmq']['version'] = '3.8.28'
# When true, distribution-provided package will be used.
# This may be useful e.g. on old distributions.
default['rabbitmq']['use_distro_version'] = false
# Allow the distro version to be optionally pinned
default['rabbitmq']['pin_distro_version'] = false
# provide options to override download urls and package names
default['rabbitmq']['deb_package'] = nil
default['rabbitmq']['deb_package_url'] = nil
default['rabbitmq']['rpm_package'] = nil
default['rabbitmq']['rpm_package_url'] = nil
# Set to true when using recipe[rabbitmq::erlang_package]
default['rabbitmq']['erlang']['enabled'] = false
# On older distributions use ESL packages unless node['rabbitmq']['erlang']['enabled']
# suggests that the intent is to use recipe[rabbitmq::erlang_package]
#
if !node['rabbitmq']['use_distro_version'] && !node['rabbitmq']['erlang']['enabled'] &&
(platform_family?('debian') && node['platform_version'].to_i < 8 ||
platform_family?('rhel') && node['platform_version'].to_i < 7)
default['erlang']['install_method'] = 'esl'
end
default['rabbitmq']['esl-erlang_package'] = 'esl-erlang-compat-R16B03-1.noarch.rpm?raw=true'
default['rabbitmq']['esl-erlang_package_url'] = 'https://github.com/jasonmcintosh/esl-erlang-compat/blob/master/rpmbuild/RPMS/noarch/'
# socat is not guaranteed to be available on CentOS 6
default['rabbitmq']['socat_package'] = 'socat-1.7.2.3-1.el6.x86_64.rpm'
default['rabbitmq']['socat_package_url'] = 'https://kojipkgs.fedoraproject.org//packages/socat/1.7.2.3/1.el6/x86_64/'
# being nil, the rabbitmq defaults will be used
default['rabbitmq']['nodename'] = nil
default['rabbitmq']['address'] = nil
default['rabbitmq']['port'] = nil
default['rabbitmq']['config'] = nil
default['rabbitmq']['logdir'] = nil
default['rabbitmq']['server_additional_erl_args'] = nil
default['rabbitmq']['ctl_erl_args'] = nil
default['rabbitmq']['user'] = 'rabbitmq'
default['rabbitmq']['group'] = 'rabbitmq'
default['rabbitmq']['homedir'] = '/var/lib/rabbitmq'
default['rabbitmq']['mnesiadir'] = "#{node['rabbitmq']['homedir']}/mnesia"
default['rabbitmq']['service_name'] = 'rabbitmq-server'
default['rabbitmq']['manage_service'] = true
# service management operation retries. These defaults
# as the same as Chef's.
default['rabbitmq']['retry'] = 0
default['rabbitmq']['retry_delay'] = 2
# See https://www.rabbitmq.com/configure.html and specifically
# https://www.rabbitmq.com/configure.html#config-file-formats
# Note that the cookbook currently uses classic config format (rabbitmq.config)
# and the docs have moved to recommend rabbitmq.conf + advanced.config where needed.
default['rabbitmq']['config_root'] = '/etc/rabbitmq'
default['rabbitmq']['config'] = "#{node['rabbitmq']['config_root']}/rabbitmq"
default['rabbitmq']['erlang_cookie_path'] = '/var/lib/rabbitmq/.erlang.cookie'
default['rabbitmq']['erlang_cookie'] = 'AnyAlphaNumericStringWillDo'
# override this if you wish to provide `rabbitmq.config.erb` in your own wrapper cookbook
default['rabbitmq']['config_template_cookbook'] = 'rabbitmq'
# override this if you wish to provide `rabbitmq-env.config.erb` in your own wrapper cookbook
default['rabbitmq']['config-env_template_cookbook'] = 'rabbitmq'
# rabbitmq.config defaults
default['rabbitmq']['default_user'] = 'guest'
default['rabbitmq']['default_pass'] = 'guest'
# loopback_users
# List of users which are only permitted to connect to the broker via a loopback interface (i.e. localhost).
# If you wish to allow the default guest user to connect remotely, you need to change this to [].
default['rabbitmq']['loopback_users'] = nil
# Erlang kernel application options
# See https://www.erlang.org/doc/man/kernel_app.html
default['rabbitmq']['kernel']['inet_dist_listen_min'] = nil
default['rabbitmq']['kernel']['inet_dist_listen_max'] = nil
# Tell Erlang what IP to bind to
default['rabbitmq']['kernel']['inet_dist_use_interface'] = nil
# clustering
default['rabbitmq']['clustering']['enable'] = false
default['rabbitmq']['clustering']['cluster_partition_handling'] = 'ignore'
default['rabbitmq']['clustering']['use_auto_clustering'] = false
default['rabbitmq']['clustering']['cluster_name'] = nil
default['rabbitmq']['clustering']['cluster_nodes'] = []
## Chef-driven clustering.
##
## Note that there are no leader/master or follower nodes in RabbitMQ,
## all nodes are equal peers: https://www.rabbitmq.com/clustering.html#peer-equality
default['rabbitmq']['clustering']['node_type'] = 'master'
default['rabbitmq']['clustering']['master_node_name'] = 'rabbit@rabbit1'
default['rabbitmq']['clustering']['cluster_node_type'] = 'disc'
# log levels
default['rabbitmq']['log_levels'] = { 'connection' => 'info' }
# Logrotate
default['rabbitmq']['logrotate']['enable'] = true
default['rabbitmq']['logrotate']['path'] = '/var/log/rabbitmq/*.log'
default['rabbitmq']['logrotate']['rotate'] = 20
default['rabbitmq']['logrotate']['frequency'] = 'weekly'
default['rabbitmq']['logrotate']['options'] = %w(missingok notifempty compress delaycompress)
default['rabbitmq']['logrotate']['sharedscripts'] = true
default['rabbitmq']['logrotate']['postrotate'] = '/usr/sbin/rabbitmqctl rotate_logs > /dev/null'
# resource usage
default['rabbitmq']['disk_free_limit_relative'] = nil
default['rabbitmq']['disk_free_limit'] = nil
default['rabbitmq']['vm_memory_high_watermark'] = nil
default['rabbitmq']['channel_max'] = nil
default['rabbitmq']['max_file_descriptors'] = 1024
default['rabbitmq']['open_file_limit'] = nil
# job control
default['rabbitmq']['job_control'] = 'initd'
# authentication and authorization backends
# For example, to enable LDAP:
# default['rabbitmq']['auth_backends'] = 'rabbit_auth_backend_internal, rabbit_auth_backend_ldap'
default['rabbitmq']['auth_backends'] = 'rabbit_auth_backend_internal'
default['rabbitmq']['ldap']['enabled'] = false
default['rabbitmq']['ldap']['conf'] = {}
# TLS
default['rabbitmq']['ssl'] = false
default['rabbitmq']['ssl_port'] = 5671
default['rabbitmq']['ssl_listen_interface'] = nil
default['rabbitmq']['ssl_cacert'] = '/path/to/cacert.pem'
default['rabbitmq']['ssl_cert'] = '/path/to/cert.pem'
default['rabbitmq']['ssl_key'] = '/path/to/key.pem'
default['rabbitmq']['ssl_verify'] = 'verify_none'
default['rabbitmq']['ssl_depth'] = 1
default['rabbitmq']['ssl_fail_if_no_peer_cert'] = false
# Specify SSL versions
# Example:
# ['tlsv1.2', 'tlsv1.1']
default['rabbitmq']['ssl_versions'] = nil
# Specify SSL ciphers
# Examples:
# ['{ecdhe_ecdsa,aes_128_cbc,sha256}', '{ecdhe_ecdsa,aes_256_cbc,sha}']
# or in OpenSSL format:
# ['"ECDHE-ECDSA-AES128-SHA256"', '"ECDHE-ECDSA-AES256-SHA"']
default['rabbitmq']['ssl_ciphers'] = nil
default['rabbitmq']['ssl_secure_renegotiate'] = true
default['rabbitmq']['ssl_honor_cipher_order'] = true
default['rabbitmq']['ssl_honor_ecc_order'] = true
default['rabbitmq']['web_console_ssl'] = false
default['rabbitmq']['web_console_ssl_port'] = 15_671
# If configured to true, allows downstream cookbooks to supply definitions on start
default['rabbitmq']['management']['load_definitions'] = false
default['rabbitmq']['management']['definitions_file'] = '/etc/rabbitmq/load_definitions.json'
# Change non SSL web console listen port
default['rabbitmq']['web_console_port'] = 15672
# Add an ability to set web console listen ip.
default['rabbitmq']['web_console_interface'] = nil
# TCP listener options, see
# https://www.rabbitmq.com/networking.html for details.
default['rabbitmq']['tcp_listen'] = true
default['rabbitmq']['port'] = 5672
default['rabbitmq']['tcp_listen_interface'] = nil
default['rabbitmq']['tcp_listen_packet'] = 'raw'
default['rabbitmq']['tcp_listen_reuseaddr'] = true
default['rabbitmq']['tcp_listen_backlog'] = 128
default['rabbitmq']['tcp_listen_nodelay'] = true
default['rabbitmq']['tcp_listen_exit_on_close'] = false
default['rabbitmq']['tcp_listen_keepalive'] = false
default['rabbitmq']['tcp_listen_linger'] = true
default['rabbitmq']['tcp_listen_linger_timeout'] = 0
default['rabbitmq']['tcp_listen_buffer'] = nil
default['rabbitmq']['tcp_listen_sndbuf'] = nil
default['rabbitmq']['tcp_listen_recbuf'] = nil
# virtualhosts
default['rabbitmq']['virtualhosts'] = []
default['rabbitmq']['disabled_virtualhosts'] = []
# users
default['rabbitmq']['enabled_users'] =
[{ :name => 'guest', :password => 'guest', :rights =>
[{ :vhost => nil, :conf => '.*', :write => '.*', :read => '.*' }]
}]
default['rabbitmq']['disabled_users'] = []
# plugins
default['rabbitmq']['enabled_plugins'] = []
default['rabbitmq']['disabled_plugins'] = []
default['rabbitmq']['community_plugins'] = {}
# systemd unit files directory
default['rabbitmq']['systemd_unit_root'] = '/etc/systemd/system/rabbitmq-server.service.d'
default['rabbitmq']['systemd']['limits']['NOFILE'] = 500_000
# platform specific settings
case node['platform_family']
when 'smartos'
default['rabbitmq']['service_name'] = 'rabbitmq'
default['rabbitmq']['config_root'] = '/opt/local/etc/rabbitmq'
default['rabbitmq']['config'] = "#{node['rabbitmq']['config_root']}/rabbitmq"
default['rabbitmq']['erlang_cookie_path'] = '/var/db/rabbitmq/.erlang.cookie'
when 'debian'
default['apt']['confd']['assume_yes'] = false
default['apt']['confd']['force-yes'] = false
end
# heartbeat
default['rabbitmq']['heartbeat'] = 60
# per default all policies and disabled policies are empty but need to be
# defined
default['rabbitmq']['policies'] = {}
default['rabbitmq']['disabled_policies'] = []
# Example HA policies
# default['rabbitmq']['policies']['ha-all']['pattern'] = '^(?!amq\.).*'
# default['rabbitmq']['policies']['ha-all']['params'] = { 'ha-mode' => 'all' }
# default['rabbitmq']['policies']['ha-all']['priority'] = 0
#
# default['rabbitmq']['policies']['ha-two']['pattern'] = '^two.'
# default['rabbitmq']['policies']['ha-two']['params'] = { 'ha-mode' => 'exactly', 'ha-params' => 2 }
# default['rabbitmq']['policies']['ha-two']['priority'] = 1
# conf
default['rabbitmq']['conf'] = {}
default['rabbitmq']['additional_rabbit_configs'] = {}
#
# Erlang packages
#
default['rabbitmq']['erlang']['version'] = nil
# HiPE's been deprecated since Erlang/OTP 22 and was removed completely in Erlang/OTP 24.
# DO NOT USE.
default['rabbitmq']['erlang']['hipe'] = false
default['rabbitmq']['erlang']['retry_delay'] = 10
# apt
deb_distro = value_for_platform(
'debian' => {
'default' => 'debian'
},
'ubuntu' => {
'default' => 'ubuntu'
}
)
default['rabbitmq']['erlang']['apt']['uri'] = "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/#{deb_distro}"
unless node['lsb'].nil?
default['rabbitmq']['erlang']['apt']['lsb_codename'] = node['lsb']['codename']
end
default['rabbitmq']['erlang']['apt']['components'] = ['main']
default['rabbitmq']['erlang']['apt']['key'] = 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key'
default['rabbitmq']['erlang']['apt']['install_options'] = %w(--fix-missing)
# yum
default['rabbitmq']['erlang']['yum']['baseurl'] = value_for_platform(
%w(centos redhat scientific oracle) => {
'< 8.0' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/7/$basearch',
'default' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/$basearch'
},
'fedora' => {
'default' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/$basearch'
},
'amazon' => {
# Amazon Linux 2022 uses el/8 as it is based on Fedora 34+
'>= 2022' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/$basearch',
# Amazon Linux 2 uses el/7 as it is based on CentOS 7
'< 2022' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/7/$basearch',
'default' => 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/$basearch'
}
)
default['rabbitmq']['erlang']['yum']['gpgkey'] = 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key'
default['rabbitmq']['erlang']['yum']['gpgcheck'] = true
default['rabbitmq']['erlang']['yum']['repo_gpgcheck'] = false
default['rabbitmq']['erlang']['yum']['enabled'] = true
# zypper
default['rabbitmq']['erlang']['zypper']['baseurl'] = 'https://download.opensuse.org/repositories/network:/messaging:/amqp/openSUSE_Leap_15.1/'
default['rabbitmq']['erlang']['zypper']['enabled'] = true