From: Guillaume Abrioux Date: Fri, 22 Sep 2017 21:50:10 +0000 (+0200) Subject: config: fix path to set `interface` in ceph.conf X-Git-Tag: v3.0.0rc11~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1946%2Fhead;p=ceph-ansible.git config: fix path to set `interface` in ceph.conf need to use `hostvars[host]['XXX']` to retrieve the monitor interface and/or radosgw interface. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1493920 Signed-off-by: Guillaume Abrioux --- diff --git a/roles/ceph-config/templates/ceph.conf.j2 b/roles/ceph-config/templates/ceph.conf.j2 index 0a6eaf5a8..22c21e398 100644 --- a/roles/ceph-config/templates/ceph.conf.j2 +++ b/roles/ceph-config/templates/ceph.conf.j2 @@ -81,7 +81,7 @@ mon host = {% if nb_mon > 0 %} [{{ hostvars[host]['monitor_address'] }}] {%- endif %} {%- else -%} - {% set interface = ["ansible_",monitor_interface]|join %} + {% set interface = 'ansible_' + hostvars[host]['monitor_interface'] %} {% if ip_version == 'ipv4' -%} {{ hostvars[host][interface][ip_version]['address'] }} {%- elif ip_version == 'ipv6' -%} @@ -199,7 +199,7 @@ rgw data = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_ho rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} {% endif %} {%- else -%} - {% set interface = ["ansible_",radosgw_interface]|join %} + {% set interface = 'ansible_' + hostvars[host]['radosgw_interface'] %} {% 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' -%} diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index dc2169a5f..4b31d3eb9 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -42,7 +42,7 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \ -e MON_IP=[{{ hostvars[inventory_hostname]['monitor_address'] }}] \ {% endif -%} {% else -%} - {% set interface = ["ansible_",monitor_interface]|join %} + {% set interface = 'ansible_' + hostvars[inventory_hostname]['monitor_interface'] %} {% if ip_version == 'ipv6' -%} -e MON_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \ {% elif ip_version == 'ipv4' -%} diff --git a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 index 25f8b5b0b..c784d3822 100644 --- a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 +++ b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 @@ -34,7 +34,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \ -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \ {% endif -%} {% else -%} - {% set interface = ["ansible_",radosgw_interface]|join %} + {% set interface = 'ansible_' + hostvars[inventory_hostname]['radosgw_interface'] %} {% if ip_version == 'ipv6' -%} -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \ {% elif ip_version == 'ipv4' -%}