Skip to content

Commit

Permalink
updates for PR #1013
Browse files Browse the repository at this point in the history
  • Loading branch information
wyardley committed Sep 6, 2024
1 parent 64cd92c commit 00ef9a4
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ The following parameters are available in the `rabbitmq` class:
* [`config`](#-rabbitmq--config)
* [`config_additional_variables`](#-rabbitmq--config_additional_variables)
* [`config_cluster`](#-rabbitmq--config_cluster)
* [`config_cowboy_opts`](#-rabbitmq--config_cowboy_opts)
* [`config_kernel_variables`](#-rabbitmq--config_kernel_variables)
* [`config_path`](#-rabbitmq--config_path)
* [`config_ranch`](#-rabbitmq--config_ranch)
Expand Down Expand Up @@ -411,6 +412,14 @@ Enable or disable clustering support.

Default value: `false`

##### <a name="-rabbitmq--config_cowboy_opts"></a>`config_cowboy_opts`

Data type: `Hash`

Hash of additional configs (key / value) for `cowboy_opts` in rabbitmq.config.

Default value: `{}`

##### <a name="-rabbitmq--config_kernel_variables"></a>`config_kernel_variables`

Data type: `Hash`
Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
$cluster_node_type = $rabbitmq::cluster_node_type
$cluster_nodes = $rabbitmq::cluster_nodes
$config = $rabbitmq::config
$config_cowboy_opts = $rabbitmq::config_cowboy_opts
$config_cluster = $rabbitmq::config_cluster
$config_cowboy_opts = $rabbitmq::config_cowboy_opts
$config_path = $rabbitmq::config_path
$config_ranch = $rabbitmq::config_ranch
$config_stomp = $rabbitmq::config_stomp
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
# @param config_cluster
# Enable or disable clustering support.
# @param config_cowboy_opts
# Additional config variables for cowboy_opts in rabbitmq.config.
# Hash of additional configs (key / value) for `cowboy_opts` in rabbitmq.config.
# @param config_kernel_variables
# Hash of Erlang kernel configuration variables to set (see [Variables Configurable in rabbitmq.config](#variables-configurable-in-rabbitmq.config)).
# @param config_path
Expand Down
44 changes: 44 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,50 @@
end
end

describe 'with config_cowboy_opts' do
context 'without SSL' do
let(:params) do
{
config_cowboy_opts: {
'max_request_line_length' => 16_000,
'max_keepalive' => 1000,
},
}
end

it 'sets expected cowboy config variables' do
is_expected.to contain_file('rabbitmq.config'). \
with_content(
%r{\{cowboy_opts, \[\n\s+\{max_keepalive, 1000\},\n\s+\{max_request_line_length, 16000\}}
)
end
end

context 'withSSL' do
let(:params) do
{
config_cowboy_opts: {
'max_request_line_length' => 16_003,
'max_keepalive' => 1002,
},
ssl: true,
ssl_port: 3141,
ssl_cacert: '/path/to/cacert',
ssl_cert: '/path/to/cert',
ssl_key: '/path/to/key',
ssl_versions: ['tlsv1.2', 'tlsv1.1'],
}
end

it 'sets expected cowboy config variables' do
is_expected.to contain_file('rabbitmq.config'). \
with_content(
%r{\{cowboy_opts, \[\n\s+\{max_keepalive, 1002\},\n\s+\{max_request_line_length, 16003\}}
)
end
end
end

describe 'rabbitmq-env configuration' do
context 'with default params' do
it 'sets environment variables' do
Expand Down

0 comments on commit 00ef9a4

Please sign in to comment.