Skip to content

Commit 00ef9a4

Browse files
committed
updates for PR #1013
1 parent 64cd92c commit 00ef9a4

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ The following parameters are available in the `rabbitmq` class:
207207
* [`config`](#-rabbitmq--config)
208208
* [`config_additional_variables`](#-rabbitmq--config_additional_variables)
209209
* [`config_cluster`](#-rabbitmq--config_cluster)
210+
* [`config_cowboy_opts`](#-rabbitmq--config_cowboy_opts)
210211
* [`config_kernel_variables`](#-rabbitmq--config_kernel_variables)
211212
* [`config_path`](#-rabbitmq--config_path)
212213
* [`config_ranch`](#-rabbitmq--config_ranch)
@@ -411,6 +412,14 @@ Enable or disable clustering support.
411412

412413
Default value: `false`
413414

415+
##### <a name="-rabbitmq--config_cowboy_opts"></a>`config_cowboy_opts`
416+
417+
Data type: `Hash`
418+
419+
Hash of additional configs (key / value) for `cowboy_opts` in rabbitmq.config.
420+
421+
Default value: `{}`
422+
414423
##### <a name="-rabbitmq--config_kernel_variables"></a>`config_kernel_variables`
415424

416425
Data type: `Hash`

manifests/config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
$cluster_node_type = $rabbitmq::cluster_node_type
1111
$cluster_nodes = $rabbitmq::cluster_nodes
1212
$config = $rabbitmq::config
13-
$config_cowboy_opts = $rabbitmq::config_cowboy_opts
1413
$config_cluster = $rabbitmq::config_cluster
14+
$config_cowboy_opts = $rabbitmq::config_cowboy_opts
1515
$config_path = $rabbitmq::config_path
1616
$config_ranch = $rabbitmq::config_ranch
1717
$config_stomp = $rabbitmq::config_stomp

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
# @param config_cluster
139139
# Enable or disable clustering support.
140140
# @param config_cowboy_opts
141-
# Additional config variables for cowboy_opts in rabbitmq.config.
141+
# Hash of additional configs (key / value) for `cowboy_opts` in rabbitmq.config.
142142
# @param config_kernel_variables
143143
# Hash of Erlang kernel configuration variables to set (see [Variables Configurable in rabbitmq.config](#variables-configurable-in-rabbitmq.config)).
144144
# @param config_path

spec/classes/rabbitmq_spec.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,50 @@
429429
end
430430
end
431431

432+
describe 'with config_cowboy_opts' do
433+
context 'without SSL' do
434+
let(:params) do
435+
{
436+
config_cowboy_opts: {
437+
'max_request_line_length' => 16_000,
438+
'max_keepalive' => 1000,
439+
},
440+
}
441+
end
442+
443+
it 'sets expected cowboy config variables' do
444+
is_expected.to contain_file('rabbitmq.config'). \
445+
with_content(
446+
%r{\{cowboy_opts, \[\n\s+\{max_keepalive, 1000\},\n\s+\{max_request_line_length, 16000\}}
447+
)
448+
end
449+
end
450+
451+
context 'withSSL' do
452+
let(:params) do
453+
{
454+
config_cowboy_opts: {
455+
'max_request_line_length' => 16_003,
456+
'max_keepalive' => 1002,
457+
},
458+
ssl: true,
459+
ssl_port: 3141,
460+
ssl_cacert: '/path/to/cacert',
461+
ssl_cert: '/path/to/cert',
462+
ssl_key: '/path/to/key',
463+
ssl_versions: ['tlsv1.2', 'tlsv1.1'],
464+
}
465+
end
466+
467+
it 'sets expected cowboy config variables' do
468+
is_expected.to contain_file('rabbitmq.config'). \
469+
with_content(
470+
%r{\{cowboy_opts, \[\n\s+\{max_keepalive, 1002\},\n\s+\{max_request_line_length, 16003\}}
471+
)
472+
end
473+
end
474+
end
475+
432476
describe 'rabbitmq-env configuration' do
433477
context 'with default params' do
434478
it 'sets environment variables' do

0 commit comments

Comments
 (0)