From 9c1a8b350b8da4a1d94fb0a28d199b8a1072522f Mon Sep 17 00:00:00 2001 From: Kirill Kouznetsov Date: Mon, 16 Oct 2017 23:09:34 +0800 Subject: [PATCH] Adds listen ip address configuration for management console. --- attributes/default.rb | 3 +++ templates/default/rabbitmq.config.erb | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index 9151a7c1..0b8122a4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -132,6 +132,9 @@ # Change non SSL web console listen port default['rabbitmq']['web_console_port'] = 15672 +# Add an ability to set web console listen ip. +default['rabbitmq']['web_console_interface'] = nil + # tcp listen options default['rabbitmq']['tcp_listen'] = true default['rabbitmq']['tcp_listen_packet'] = 'raw' diff --git a/templates/default/rabbitmq.config.erb b/templates/default/rabbitmq.config.erb index e9cd19e7..a77e8fb2 100644 --- a/templates/default/rabbitmq.config.erb +++ b/templates/default/rabbitmq.config.erb @@ -9,6 +9,9 @@ <% if node['rabbitmq']['web_console_ssl'] -%> {rabbitmq_management, [ {listener, [{port, <%= node['rabbitmq']['web_console_ssl_port'] %>}, +<% if node['rabbitmq']['web_console_interface'] -%> + {ip, "<%= node['rabbitmq']['web_console_interface'] %>"}, +<% end -%> {ssl, true}, {ssl_opts, [{cacertfile,"<%= node['rabbitmq']['ssl_cacert'] %>"}, {certfile,"<%= node['rabbitmq']['ssl_cert'] %>"}, @@ -22,6 +25,9 @@ {rabbitmq_management, [ {listener, [ {port, <%= node['rabbitmq']['web_console_port'] %>} +<% if node['rabbitmq']['web_console_interface'] -%> + ,{ip, "<%= node['rabbitmq']['web_console_interface'] %>"} +<% end -%> ]} ]}, <% end %>