From 4a55085914842d35bea8113c43d086ceb25da88f Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 22 Sep 2017 14:45:15 +0200 Subject: [PATCH] config: fix rgw interface when using different interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Conf file generation failing on rgw nodes when nodes have different interface names. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1493552 Signed-off-by: Sébastien Han --- roles/ceph-config/templates/ceph.conf.j2 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/ceph-config/templates/ceph.conf.j2 b/roles/ceph-config/templates/ceph.conf.j2 index db2764a4b..0a6eaf5a8 100644 --- a/roles/ceph-config/templates/ceph.conf.j2 +++ b/roles/ceph-config/templates/ceph.conf.j2 @@ -165,11 +165,10 @@ log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} {% endif %} {%- else -%} - {% set interface = ["ansible_",radosgw_interface]|join %} - {% if ip_version == 'ipv6' -%} - rgw frontends = civetweb port=[{{ hostvars[host][interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} - {%- elif ip_version == 'ipv4' -%} - rgw frontends = civetweb port={{ hostvars[host][interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} + {% if ip_version == 'ipv4' -%} + rgw frontends = civetweb port={{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} + {%- elif ip_version == 'ipv6' -%} + rgw frontends = civetweb port=[{{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} {% endif %} {%- endif %} {% endif %} -- 2.47.3