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 %>