From 7054b27dbb8bc893c50f66b492b7e14e5bc92237 Mon Sep 17 00:00:00 2001 From: "yj.bai" Date: Wed, 18 Dec 2019 00:27:12 +0800 Subject: [PATCH] Fix unable to connect to epmd when deploy rabbitmq by train with ipv6 deploy rabbitmq cluster by train with ipv6 report: unable to connect to epmd (port 4369) on control-1: address (cannot connect to host/port) Closes-Bug: #1856725 Change-Id: I36ebb4e196ece8a304269e8c85e39dda72faae50 Signed-off-by: yj.bai --- ansible/roles/common/tasks/config.yml | 21 +++++++++++++++++++ .../common/templates/kolla-toolbox.json.j2 | 12 +++++++++++ .../rabbitmq/templates/rabbitmq-env.conf.j2 | 1 + 3 files changed, 34 insertions(+) diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 123912f671..d4285c3256 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -363,5 +363,26 @@ - item.key != "kolla-toolbox" 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 + dest: /etc/kolla/kolla-toolbox/rabbitmq-env.conf + mode: "0600" + become: true + when: + api_address_family == "ipv6" + +- name: Copy rabbitmq erl_intr to kolla toolbox + copy: + content: | + {inet6,true}. + dest: /etc/kolla/kolla-toolbox/erl_inetrc + mode: "0600" + become: true + when: + api_address_family == "ipv6" + - include_tasks: check-containers.yml when: kolla_action != "config" diff --git a/ansible/roles/common/templates/kolla-toolbox.json.j2 b/ansible/roles/common/templates/kolla-toolbox.json.j2 index 1f7a56a9f1..79c69e92f3 100644 --- a/ansible/roles/common/templates/kolla-toolbox.json.j2 +++ b/ansible/roles/common/templates/kolla-toolbox.json.j2 @@ -6,6 +6,18 @@ "dest": "/var/lib/rabbitmq/.erlang.cookie", "owner": "rabbitmq", "perm": "0600" + }{% endif %}{% if api_address_family == 'ipv6' %}, + { + "source": "{{ container_config_directory }}/rabbitmq-env.conf", + "dest": "/etc/rabbitmq/rabbitmq-env.conf", + "owner": "rabbitmq", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/erl_inetrc", + "dest": "/etc/rabbitmq/erl_inetrc", + "owner": "rabbitmq", + "perm": "0600" }{% endif %} ], "permissions": [ diff --git a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 index 050cb1fd00..28fd9043be 100644 --- a/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 +++ b/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2 @@ -7,3 +7,4 @@ RABBITMQ_CTL_ERL_ARGS="{% if api_address_family == 'ipv6' %}-proto_dist inet6_tc export ERL_EPMD_ADDRESS={{ api_interface_address }} export ERL_EPMD_PORT={{ role_rabbitmq_epmd_port }} +export ERL_INETRC=/etc/rabbitmq/erl_inetrc