Skip to content

Commit

Permalink
Add support for cowboy_opts config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan MARTIN committed Sep 4, 2024
1 parent 4eed5e4 commit 4c1eb9d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$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_path = $rabbitmq::config_path
$config_ranch = $rabbitmq::config_ranch
Expand Down
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
# Additional config variables in rabbitmq.config
# @param config_cluster
# Enable or disable clustering support.
# @param config_cowboy_opts
# Additional config variables 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 Expand Up @@ -356,7 +358,8 @@
Hash $cluster = $rabbitmq::cluster,
Enum['ram', 'disc'] $cluster_node_type = 'disc',
Array $cluster_nodes = [],
String $config = 'rabbitmq/rabbitmq.config.epp',
String $config
Hash $config_cowboy_opts = {}, = 'rabbitmq/rabbitmq.config.epp',
Boolean $config_cluster = false,
Stdlib::Absolutepath $config_path = '/etc/rabbitmq/rabbitmq.config',
Boolean $config_ranch = true,
Expand Down
12 changes: 11 additions & 1 deletion templates/rabbitmq.config.epp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
{ip, "<%= $rabbitmq::config::management_ip_address %>"},
<%- } -%>
{port, <%= $rabbitmq::config::ssl_management_port %>},
<%- if !$rabbitmq::config::config_cowboy_opts.empty {-%>
{cowboy_opts, [
<%- $rabbitmq::config::config_cowboy_opts.keys.sort.each |$k| { -%>
{<%= $k %>, <%= $rabbitmq::config::config_cowboy_opts[$k] %>}<% if $k != $rabbitmq::config::config_cowboy_opts.keys.sort[-1] { %>,<%- } %>
<%- } -%>
]},
<%- } -%>
{ssl, true},
{ssl_opts, [
<%- if $rabbitmq::config::ssl_management_cacert {-%>
Expand Down Expand Up @@ -164,7 +171,10 @@
<%- if $rabbitmq::config::management_ip_address {-%>
{ip, "<%= $rabbitmq::config::management_ip_address %>"},
<%- } -%>
{port, <%= $rabbitmq::config::management_port %>}
{port, <%= $rabbitmq::config::management_port %>}<% if !$rabbitmq::config::config_cowboy_opts.empty {%>,
{cowboy_opts, [<%- $rabbitmq::config::config_cowboy_opts.keys.sort.each |$k| { %>
{<%= $k %>, <%= $rabbitmq::config::config_cowboy_opts[$k] %>}<% if $k != $rabbitmq::config::config_cowboy_opts.keys.sort[-1] { %>,<%- }} %>
]}<%- } %>
<%- } -%>
]}
<%- } -%>
Expand Down

0 comments on commit 4c1eb9d

Please sign in to comment.