ceph-common: fixes bug related to monitor_interface set in inventory

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>
pull/1666/head
Andrew Schoen 2017-07-06 13:33:49 -05:00 committed by Guillaume Abrioux
parent b9be96983c
commit a9a3d24a3d
1 changed files with 2 additions and 2 deletions

View 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 %}