]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
config: fix path to set `interface` in ceph.conf 1946/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 22 Sep 2017 21:50:10 +0000 (23:50 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Sat, 23 Sep 2017 12:18:28 +0000 (14:18 +0200)
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 <gabrioux@redhat.com>
roles/ceph-config/templates/ceph.conf.j2
roles/ceph-mon/templates/ceph-mon.service.j2
roles/ceph-rgw/templates/ceph-radosgw.service.j2

index 0a6eaf5a8c9a3cac77dcc34bf590f91da734dddd..22c21e39826b7a2f2ccd6a11b2ef734302364e1e 100644 (file)
@@ -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' -%}
index dc2169a5f31c0435e4ecbd8b68184dab2400dc63..4b31d3eb952d6d06f37a0f729b98bfeae8b811d7 100644 (file)
@@ -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' -%}
index 25f8b5b0ba9a27d0d9d31ec09a7542fa885d5755..c784d382290cccb1e2b3c8cf1c95165edd858066 100644 (file)
@@ -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' -%}