diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 465bf6e1fe..671e8a1971 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -257,7 +257,7 @@ enable_kibana: "{{ 'yes' if enable_central_logging | bool else 'no' }}" # RabbitMQ options #################### rabbitmq_user: "openstack" - +rabbitmq_version: "rabbitmq_server-3.5.7/plugins/rabbitmq_clusterer-3.5.x-189b3a81.ez/rabbitmq_clusterer-3.5.x-189b3a81/ebin" #################### # HAProxy options diff --git a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 index 47ef8fe06c..41add3fa53 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 @@ -1,8 +1,10 @@ RABBITMQ_NODENAME=rabbit +{% if orchestration_engine == 'ANSIBLE' %} RABBITMQ_BOOT_MODULE=rabbit_clusterer +RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-pa /usr/lib/rabbitmq/lib/{{ rabbitmq_version }}" +{%- endif %} RABBITMQ_LOG_BASE=/var/log/kolla/rabbitmq -RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.7/plugins/rabbitmq_clusterer-3.5.x-189b3a81.ez/rabbitmq_clusterer-3.5.x-189b3a81/ebin" # TODO(sdake, vhosakot) # erlang by default binds to wildcard (all interfaces) and can potentially diff --git a/ansible/roles/rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/rabbitmq/templates/rabbitmq.config.j2 index 7db5f020d7..f0d85b0f8e 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq.config.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq.config.j2 @@ -1,22 +1,24 @@ [ {kernel, [ - {inet_dist_use_interface, {% raw %}{{% endraw %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] | regex_replace('\.', ',') }}}}, + {inet_dist_use_interface, {% raw %}{{% endraw %}{{ api_interface_address | regex_replace('\.', ',') }}}}, {inet_dist_listen_min, {{ rabbitmq_cluster_port }}}, {inet_dist_listen_max, {{ rabbitmq_cluster_port }}} ]}, {rabbit, [ {tcp_listeners, [ - {"{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}", {{ rabbitmq_port }}} - ]}, + {"{{ api_interface_address }}", {{ rabbitmq_port }}} + ]}{% if orchestration_engine == 'ANSIBLE' %}, {cluster_partition_handling, autoheal} + {%- endif %} ]}, {rabbitmq_management, [ {listener, [ - {ip, "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"}, + {ip, "{{ api_interface_address }}"}, {port, {{ rabbitmq_management_port }}} ]}, {load_definitions, "/etc/rabbitmq/definitions.json"} - ]}, + ]}{% if orchestration_engine == 'ANSIBLE' %}, {rabbitmq_clusterer, [{config, "/etc/rabbitmq/rabbitmq-clusterer.config"}]} +{%- endif %} ]. % EOF