From 701dc20f507bfde6e08e6b77877c55b9335266f0 Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Wed, 23 Nov 2022 15:08:06 +0100 Subject: [PATCH] Add ability to configure rabbitmq As rabbitmq's configuration file is not ini or yaml file, there is no option to extend configuration by new config options via merge_configs or merge_yaml. This patch moves config options to dictionary so it can be overriden in /etc/kolla/globals.yml. Change-Id: I5cd772f4fb80a0e200fb24d67be735ca81e3fdeb --- ansible/roles/rabbitmq/defaults/main.yml | 1 + ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 | 3 +++ .../notes/rabbitmq-configuration-6b100a390734dc29.yaml | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 releasenotes/notes/rabbitmq-configuration-6b100a390734dc29.yaml diff --git a/ansible/roles/rabbitmq/defaults/main.yml b/ansible/roles/rabbitmq/defaults/main.yml index 867e6cd050..388369f58b 100644 --- a/ansible/roles/rabbitmq/defaults/main.yml +++ b/ansible/roles/rabbitmq/defaults/main.yml @@ -84,6 +84,7 @@ rabbitmq_server_additional_erl_args: "+S 2:2 +sbwt none +sbwtdcpu none +sbwtdio rabbitmq_tls_options: {} # To avoid split-brain rabbitmq_cluster_partition_handling: "pause_minority" +rabbitmq_extra_config: {} #################### # Plugins diff --git a/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 b/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 index eef0db9083..e61031334f 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2 @@ -11,6 +11,9 @@ cluster_partition_handling = {{ rabbitmq_cluster_partition_handling }} management.listener.ip = {{ api_interface_address }} management.listener.port = {{ role_rabbitmq_management_port }} management.load_definitions = /etc/rabbitmq/definitions.json +{% for key, value in rabbitmq_extra_config.items() %} +{{ key }} = {{ value }} +{% endfor %} cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config {% for host in groups[role_rabbitmq_groups] %} diff --git a/releasenotes/notes/rabbitmq-configuration-6b100a390734dc29.yaml b/releasenotes/notes/rabbitmq-configuration-6b100a390734dc29.yaml new file mode 100644 index 0000000000..86728bd711 --- /dev/null +++ b/releasenotes/notes/rabbitmq-configuration-6b100a390734dc29.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the ability to configure rabbitmq via ``rabbitmq_extra_config`` + which can be overriden in globals.yml.