From dd65c5ebb1d185d15beb5cf2baf84547316c9e46 Mon Sep 17 00:00:00 2001 From: dexter Date: Fri, 28 Aug 2015 00:41:15 +0800 Subject: [PATCH] use hostvars for monitor interface in ceph.conf if available, else, fallback to just the plain monitor_interface var --- roles/ceph-common/templates/ceph.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index df051ccf9..fc19de1a0 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/templates/ceph.conf.j2 @@ -91,7 +91,7 @@ {% if hostvars[host]['ansible_hostname'] is defined %} [mon.{{ hostvars[host]['ansible_hostname'] }}] host = {{ hostvars[host]['ansible_hostname'] }} - mon addr = {{ hostvars[host]['ansible_' + hostvars[host]['monitor_interface']]['ipv4']['address'] }} + mon addr = {{ hostvars[host]['ansible_' + (hostvars[host]['monitor_interface'] if hostvars[host]['monitor_interface'] is defined else monitor_interface) ]['ipv4']['address'] }} {% endif %} {% endfor %}