]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: fixes bug related to monitor_interface set in inventory
authorAndrew Schoen <aschoen@redhat.com>
Thu, 6 Jul 2017 18:33:49 +0000 (13:33 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 12 Jul 2017 14:34:41 +0000 (16:34 +0200)
The ceph.conf template needs to look for the value of monitor_interface
in hostvars[host] because there might be different values set per host.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-common/templates/ceph.conf.j2

index eec6029c3d1411d207caa60d39537275728b07ea..34b1a8d4f75a0b9b4cf562c5845a5d4eee5233f1 100644 (file)
@@ -46,9 +46,9 @@ mon host = {% for host in groups[mon_group_name] -%}
       {%- endif %}
     {%- else -%}
       {% if ip_version == 'ipv4' -%}
-       {{ hostvars[host]['ansible_' + monitor_interface][ip_version]['address'] }}
+       {{ hostvars[host]['ansible_' + hostvars[host]['monitor_interface']][ip_version]['address'] }}
       {%- elif ip_version == 'ipv6' -%}
-       [{{ hostvars[host]['ansible_' + monitor_interface][ip_version][0]['address'] }}]
+       [{{ hostvars[host]['ansible_' + hostvars[host]['monitor_interface']][ip_version][0]['address'] }}]
       {%- endif %}
     {%- endif %}
    {% if not loop.last -%},{%- endif %}