From a9a3d24a3dc70c93577a71fe129e87fe2c8ac4b2 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 6 Jul 2017 13:33:49 -0500 Subject: [PATCH] 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 --- roles/ceph-common/templates/ceph.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index eec6029c3..34b1a8d4f 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/templates/ceph.conf.j2 @@ -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 %}