From 95d80ad3d30c90b9bb07ef46946779078ebec289 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 21 Apr 2016 09:09:16 -0500 Subject: [PATCH] correctly set mon addr when monitor_interface is defined in group_vars This fixes the ceph.conf template so that it will look for an inventory defined value for monitor_interface or for monitor_interface defined in a group_vars file. Signed-off-by: Andrew Schoen --- roles/ceph-common/templates/ceph.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index 113e738c3..23482bdce 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/templates/ceph.conf.j2 @@ -99,7 +99,8 @@ host = {{ hostvars[host]['ansible_fqdn'] }} [mon.{{ hostvars[host]['ansible_hostname'] }}] host = {{ hostvars[host]['ansible_hostname'] }} {% endif %} -{% if hostvars[host]['monitor_interface'] is defined and hostvars[host]['monitor_interface'] != "interface" %} +# we need to check if monitor_interface is defined in the inventory per host or if it's set in a group_vars file +{% if (hostvars[host]['monitor_interface'] is defined and hostvars[host]['monitor_interface'] != "interface") or monitor_interface != "interface" %} {% include 'mon_addr_interface.j2' %} {% else %} {% include 'mon_addr_address.j2' %}