Skip to content

Commit 4c1eb9d

Browse files
author
Jordan MARTIN
committed
Add support for cowboy_opts config
1 parent 4eed5e4 commit 4c1eb9d

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

manifests/config.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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
1314
$config_cluster = $rabbitmq::config_cluster
1415
$config_path = $rabbitmq::config_path
1516
$config_ranch = $rabbitmq::config_ranch

manifests/init.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
# Additional config variables in rabbitmq.config
138138
# @param config_cluster
139139
# Enable or disable clustering support.
140+
# @param config_cowboy_opts
141+
# Additional config variables for cowboy_opts in rabbitmq.config.
140142
# @param config_kernel_variables
141143
# Hash of Erlang kernel configuration variables to set (see [Variables Configurable in rabbitmq.config](#variables-configurable-in-rabbitmq.config)).
142144
# @param config_path
@@ -356,7 +358,8 @@
356358
Hash $cluster = $rabbitmq::cluster,
357359
Enum['ram', 'disc'] $cluster_node_type = 'disc',
358360
Array $cluster_nodes = [],
359-
String $config = 'rabbitmq/rabbitmq.config.epp',
361+
String $config
362+
Hash $config_cowboy_opts = {}, = 'rabbitmq/rabbitmq.config.epp',
360363
Boolean $config_cluster = false,
361364
Stdlib::Absolutepath $config_path = '/etc/rabbitmq/rabbitmq.config',
362365
Boolean $config_ranch = true,

templates/rabbitmq.config.epp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@
136136
{ip, "<%= $rabbitmq::config::management_ip_address %>"},
137137
<%- } -%>
138138
{port, <%= $rabbitmq::config::ssl_management_port %>},
139+
<%- if !$rabbitmq::config::config_cowboy_opts.empty {-%>
140+
{cowboy_opts, [
141+
<%- $rabbitmq::config::config_cowboy_opts.keys.sort.each |$k| { -%>
142+
{<%= $k %>, <%= $rabbitmq::config::config_cowboy_opts[$k] %>}<% if $k != $rabbitmq::config::config_cowboy_opts.keys.sort[-1] { %>,<%- } %>
143+
<%- } -%>
144+
]},
145+
<%- } -%>
139146
{ssl, true},
140147
{ssl_opts, [
141148
<%- if $rabbitmq::config::ssl_management_cacert {-%>
@@ -164,7 +171,10 @@
164171
<%- if $rabbitmq::config::management_ip_address {-%>
165172
{ip, "<%= $rabbitmq::config::management_ip_address %>"},
166173
<%- } -%>
167-
{port, <%= $rabbitmq::config::management_port %>}
174+
{port, <%= $rabbitmq::config::management_port %>}<% if !$rabbitmq::config::config_cowboy_opts.empty {%>,
175+
{cowboy_opts, [<%- $rabbitmq::config::config_cowboy_opts.keys.sort.each |$k| { %>
176+
{<%= $k %>, <%= $rabbitmq::config::config_cowboy_opts[$k] %>}<% if $k != $rabbitmq::config::config_cowboy_opts.keys.sort[-1] { %>,<%- }} %>
177+
]}<%- } %>
168178
<%- } -%>
169179
]}
170180
<%- } -%>

0 commit comments

Comments
 (0)