Allow override of rabbitmq config in kolla toolbox

Certain overrides for rabbitmq may need to be set for `rabbitmqctl` in
kolla-toolbox aswell.
This commit allows to override `rabbitmq-env.conf` and `erl_inetrc` in
kolla-toolbox.

Change-Id: Idef6adcf9700f75a2db503444a8de093ee21a9c5
This commit is contained in:
Jan Horstmann 2021-04-08 16:11:11 +02:00 committed by Radosław Piliszek
parent 13200ace33
commit f8e3e169c3
5 changed files with 25 additions and 12 deletions

View File

@ -263,26 +263,29 @@
with_dict: "{{ common_services }}"
- name: Copy rabbitmq-env.conf to kolla toolbox
copy:
content: |
RABBITMQ_CTL_ERL_ARGS="-proto_dist inet6_tcp"
export ERL_INETRC=/etc/rabbitmq/erl_inetrc
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/kolla-toolbox/rabbitmq-env.conf"
mode: "0600"
with_first_found:
- "{{ node_custom_config }}/kolla-toolbox/{{ inventory_hostname }}/rabbitmq-env.conf"
- "{{ node_custom_config }}/kolla-toolbox/rabbitmq-env.conf"
- "rabbitmq-env.conf.j2"
become: true
when:
- common_services['kolla-toolbox'] | service_enabled_and_mapped_to_host
- enable_rabbitmq | bool
- api_address_family == "ipv6"
- name: Copy rabbitmq erl_intr to kolla toolbox
copy:
content: |
{inet6,true}.
- name: Copy rabbitmq erl_inetrc to kolla toolbox
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/kolla-toolbox/erl_inetrc"
mode: "0600"
become: true
with_first_found:
- "{{ node_custom_config }}/kolla-toolbox/{{ inventory_hostname }}/erl_inetrc"
- "{{ node_custom_config }}/kolla-toolbox/erl_inetrc"
- "erl_inetrc.j2"
when:
- common_services['kolla-toolbox'] | service_enabled_and_mapped_to_host
- enable_rabbitmq | bool
- api_address_family == "ipv6"

View File

@ -0,0 +1,3 @@
{% if api_address_family == 'ipv6' %}
{inet6,true}.
{% endif %}

View File

@ -6,7 +6,7 @@
"dest": "/var/lib/rabbitmq/.erlang.cookie",
"owner": "rabbitmq",
"perm": "0600"
}{% if api_address_family == 'ipv6' %},
},
{
"source": "{{ container_config_directory }}/rabbitmq-env.conf",
"dest": "/etc/rabbitmq/rabbitmq-env.conf",
@ -18,7 +18,7 @@
"dest": "/etc/rabbitmq/erl_inetrc",
"owner": "rabbitmq",
"perm": "0600"
}{% endif %}{% endif %}
}{% endif %}
],
"permissions": [
{

View File

@ -0,0 +1,2 @@
RABBITMQ_CTL_ERL_ARGS="{% if api_address_family == 'ipv6' %}-proto_dist inet6_tcp {% endif %}"
export ERL_INETRC=/etc/rabbitmq/erl_inetrc

View File

@ -0,0 +1,5 @@
---
features:
- |
Added support to override rabbitmq config (``erl_inetrc`` and
``rabbitmq-env.conf``) in the ``kolla-toolbox`` container.