Skip to content

Commit

Permalink
Added interfaces option to set what interfaces rabbitmq binds to.
Browse files Browse the repository at this point in the history
Added 'interface' and 'ssl_interface' options to ::rabbitmq to allow the
user to set which interface they want to bind rabbitmq ports too. By
default it binds to all ipv4 and ipv6 interfaces. This would allow users
to use "0.0.0.0" or "127.0.0.1" to be explicit.
  • Loading branch information
danielgadd committed Feb 10, 2015
1 parent 654f343 commit a8e4ec6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$env_config = $rabbitmq::params::env_config,
$env_config_path = $rabbitmq::params::env_config_path,
$erlang_cookie = $rabbitmq::params::erlang_cookie,
$interface = $rabbitmq::params::interface,
$management_port = $rabbitmq::params::management_port,
$node_ip_address = $rabbitmq::params::node_ip_address,
$package_apt_pin = $rabbitmq::params::package_apt_pin,
Expand All @@ -35,6 +36,7 @@
$ssl_cert = $rabbitmq::params::ssl_cert,
$ssl_key = $rabbitmq::params::ssl_key,
$ssl_port = $rabbitmq::params::ssl_port,
$ssl_interface = $rabbitmq::params::ssl_interface,
$ssl_management_port = $rabbitmq::params::ssl_management_port,
$ssl_stomp_port = $rabbitmq::params::ssl_stomp_port,
$ssl_verify = $rabbitmq::params::ssl_verify,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$env_config = 'rabbitmq/rabbitmq-env.conf.erb'
$env_config_path = '/etc/rabbitmq/rabbitmq-env.conf'
$erlang_cookie = undef
$interface = 'UNSET'
$node_ip_address = 'UNSET'
$plugin_dir = "/usr/lib/rabbitmq/lib/rabbitmq_server-${version}/plugins"
$port = '5672'
Expand All @@ -69,6 +70,7 @@
$ssl_cert = 'UNSET'
$ssl_key = 'UNSET'
$ssl_port = '5671'
$ssl_interface = 'UNSET'
$ssl_management_port = '15671'
$ssl_stomp_port = '6164'
$ssl_verify = 'verify_none'
Expand Down
6 changes: 6 additions & 0 deletions templates/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
<%- end -%>
<%- if @ssl_only -%>
{tcp_listeners, []},
<%- elsif @interface != 'UNSET' -%>
{tcp_listeners, [{"<%= @interface%>", <%= @port %>}]},
<%- end -%>
<%- if @ssl -%>
<%- if @ssl_interface != 'UNSET' -%>
{ssl_listeners, [{"<%= @ssl_interface%>", <%= @ssl_port %>}]},
<%- else -%>
{ssl_listeners, [<%= @ssl_port %>]},
<%- end -%>
{ssl_options, [<%- if @ssl_cacert != 'UNSET' -%>{cacertfile,"<%= @ssl_cacert %>"},<%- end -%>
{certfile,"<%= @ssl_cert %>"},
{keyfile,"<%= @ssl_key %>"},
Expand Down

0 comments on commit a8e4ec6

Please sign in to comment.