use hostvars for monitor interface in ceph.conf if available, else, fallback to just the plain monitor_interface var

pull/389/head
dexter 2015-08-28 00:41:15 +08:00
parent a39bd9f2a6
commit dd65c5ebb1
1 changed files with 1 additions and 1 deletions

View File

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