From 15e8837dd3972159f5d83fd95db5fc69f80f6139 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 11 Jul 2019 22:15:41 +0100 Subject: [PATCH] Add defaults for rabbitmq managment and erlang bind addresses These default to 0.0.0.0 and can be overriden in a real deployment where the correct management network address is known. Change-Id: If989ccee6449578316e2e8dbe502b6b17c7af9c5 --- defaults/main.yml | 3 +++ templates/rabbitmq-env.j2 | 4 ++++ templates/rabbitmq.config.j2 | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4e48d549..b25e44b2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -121,6 +121,9 @@ rabbitmq_memory_high_watermark: 0.2 # RabbitMQ collect statistics interval rabbitmq_collect_statistics_interval: 5000 +# RabbitMQ Management service bind address +rabbitmq_management_bind_address: 0.0.0.0 + # RabbitMQ Management rates mode rabbitmq_management_rates_mode: basic diff --git a/templates/rabbitmq-env.j2 b/templates/rabbitmq-env.j2 index 918ee1a3..40bcece2 100644 --- a/templates/rabbitmq-env.j2 +++ b/templates/rabbitmq-env.j2 @@ -3,3 +3,7 @@ # Set ERLANG VM parameters RABBITMQ_IO_THREAD_POOL_SIZE={{ rabbitmq_async_threads }} RABBITMQ_SERVER_ERL_ARGS="+P {{ rabbitmq_process_limit }}" + +{% if (rabbitmq_management_bind_address != '0.0.0.0') %} +export ERL_EPMD_ADDRESS={{ rabbitmq_management_bind_address }} +{% endif %} diff --git a/templates/rabbitmq.config.j2 b/templates/rabbitmq.config.j2 index 58139657..6bbc78de 100644 --- a/templates/rabbitmq.config.j2 +++ b/templates/rabbitmq.config.j2 @@ -38,8 +38,12 @@ ] }, { rabbitmq_management, [ - { rates_mode, {{ rabbitmq_management_rates_mode }} } + { rates_mode, {{ rabbitmq_management_rates_mode }} }, + { listener, [{ip, "{{ rabbitmq_management_bind_address }}" }]} ] }, + {kernel, [ + {inet_dist_use_interface, { {{ rabbitmq_management_bind_address|replace('.',',') }} } } + ]}, {mnesia, [{dump_log_write_threshold, {{ mnesia_dump_log_write_threshold }} }]} ].