From: dexter Date: Thu, 27 Aug 2015 16:41:15 +0000 (+0800) Subject: use hostvars for monitor interface in ceph.conf if available, else, fallback to just... X-Git-Tag: v1.0.0~120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F389%2Fhead;p=ceph-ansible.git use hostvars for monitor interface in ceph.conf if available, else, fallback to just the plain monitor_interface var --- 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 %}