diff --git a/defaults/main.yml b/defaults/main.yml index fe5ab3d9..2d4bd965 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -287,6 +287,8 @@ rabbitmq_port_bindings: tcp_listeners: "0.0.0.0": 5672 +rabbitmq_additional_config: {} + rabbitmq_init_overrides: Service: LimitNOFILE: "{{ rabbitmq_ulimit }}" diff --git a/doc/source/configure-rabbitmq.rst b/doc/source/configure-rabbitmq.rst index b8d2d24e..bc3cf217 100644 --- a/doc/source/configure-rabbitmq.rst +++ b/doc/source/configure-rabbitmq.rst @@ -34,3 +34,17 @@ between each OpenStack service and RabbitMQ. Setting this variable to ``false`` disables SSL encryption between OpenStack services and RabbitMQ and configures all services to use the plain text port, 5672. + +Add custom configuration to RabbitMQ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To add custom configuration, e.g. to configure installed plugins, +can be accomplished by defining a variable ``rabbitmq_additional_config`` +and add you configuration as a block to this variable. Make sure to +not add redundent configuration + +.. code-block:: yaml + + rabbitmq_additional_config: + prometheus.tcp.port: 15680 + prometheus.tcp.ip: 0.0.0.0 diff --git a/releasenotes/notes/rabbitmq_additional_config-8d5c0c0b6fc6d750.yaml b/releasenotes/notes/rabbitmq_additional_config-8d5c0c0b6fc6d750.yaml new file mode 100644 index 00000000..bf2389a8 --- /dev/null +++ b/releasenotes/notes/rabbitmq_additional_config-8d5c0c0b6fc6d750.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add ``rabbitmq_additional_config`` to be able to add additional + configuration e.g. to add configuration for plugins. diff --git a/templates/rabbitmq.conf.j2 b/templates/rabbitmq.conf.j2 index 47c4f6ad..75a9e9a6 100644 --- a/templates/rabbitmq.conf.j2 +++ b/templates/rabbitmq.conf.j2 @@ -74,3 +74,11 @@ management.ssl.fail_if_no_peer_cert = {{ rabbitmq_ssl_fail_if_no_peer_cert | low management.tcp.ip = {{ rabbitmq_management_bind_address }} management.tcp.port = {{ rabbitmq_management_bind_tcp_port }} {% endif %} + +{% if rabbitmq_additional_config | length > 0 %} +# Custom configuration + +{% for config_key, config_value in rabbitmq_additional_config.items() %} +{{ config_key }} = {{ config_value }} +{% endfor %} +{% endif %}